annotate level1/cmds/format.asm @ 2798:b70d93f8d7ce lwtools-port

Updated coco1/modules/makefile and coco3/modules/makefile to help resolve issues with i(x) and s(x) descriptors. Updated level1/coco1/modules/makefile & level2/coco3/modules/makefile so that correct values would be sent to assembler when building superdesc.asm for s(x).dd and i(x).dd descriptors.
author drencor-xeen
date Mon, 28 Jan 2013 16:13:05 -0600
parents c58baa9276c8
children 86f00c7593bc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1 ********************************************************************
1697
cc8ef69d1943 Format now has rolling track output
boisy
parents: 1683
diff changeset
2 * Format - RBF Disk format program
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
3 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
4 * $Id$
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
5 *
1683
786453492c1e Format doesn't multiply total sectors * bps if TYP.DSQ bit is clear
boisy
parents: 1682
diff changeset
6 * Notes:
786453492c1e Format doesn't multiply total sectors * bps if TYP.DSQ bit is clear
boisy
parents: 1682
diff changeset
7 * 1. If the TYP.DSQ bit in IT.TYP is clear, then the total number
786453492c1e Format doesn't multiply total sectors * bps if TYP.DSQ bit is clear
boisy
parents: 1682
diff changeset
8 * of sectors is NOT multiplied by the bytes per sector. This
786453492c1e Format doesn't multiply total sectors * bps if TYP.DSQ bit is clear
boisy
parents: 1682
diff changeset
9 * means that descriptors using partition offsets will need to
786453492c1e Format doesn't multiply total sectors * bps if TYP.DSQ bit is clear
boisy
parents: 1682
diff changeset
10 * fill IT.CYL, IT.SID and IT.SCT with values that reflect the
786453492c1e Format doesn't multiply total sectors * bps if TYP.DSQ bit is clear
boisy
parents: 1682
diff changeset
11 * number of 256 byte sectors on the disk.
786453492c1e Format doesn't multiply total sectors * bps if TYP.DSQ bit is clear
boisy
parents: 1682
diff changeset
12 *
1325
84ea83668304 Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents: 961
diff changeset
13 * Edt/Rev YYYY/MM/DD Modified by
84ea83668304 Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents: 961
diff changeset
14 * Comment
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
15 * ------------------------------------------------------------------
1325
84ea83668304 Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents: 961
diff changeset
16 * 22 ????/??/??
84ea83668304 Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents: 961
diff changeset
17 * From Tandy OS-9 Level Two VR 02.00.01.
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
18 *
1325
84ea83668304 Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents: 961
diff changeset
19 * 23 2003/01/06 JC
84ea83668304 Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents: 961
diff changeset
20 * Format incorrect/clusters summary: now, specifying cluster size works.
84ea83668304 Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents: 961
diff changeset
21 * Fixed bug where format showed an improper number of sectors formatted
84ea83668304 Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents: 961
diff changeset
22 * at the summary if the number of sectors was a large number.
84ea83668304 Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents: 961
diff changeset
23 * This was most notable when formatting large disks, such as hard drives.
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
24 *
1675
ace81be91ae9 Updates for SmartWatch, format, etc.
boisy
parents: 1670
diff changeset
25 * 24 2004/07/20 Boisy G. Pitre
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
26 * Revamped to display summary similar to OS-9/68K. Also, format now
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
27 * checks the TYPH.DSQ bit in order to query the drive for its size.
1697
cc8ef69d1943 Format now has rolling track output
boisy
parents: 1683
diff changeset
28 * A rolling track counter that stays on the same line is now used
cc8ef69d1943 Format now has rolling track output
boisy
parents: 1683
diff changeset
29 * instead of the scrolling track counter, and 4 byte track numbers
cc8ef69d1943 Format now has rolling track output
boisy
parents: 1683
diff changeset
30 * are now shown instead of 3 byte track numbers.
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
31 * Also, if a cluster size is not specified on the command line,
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
32 * the best one is automatically calculated.
1899
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
33 *
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
34 * 2005-10-25 P.Harvey-Smith.
1899
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
35 * Added support for formatting Dragon floppies, this is required because
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
36 * dragon floppies are aranged thus :-
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
37 * LSN Purpose
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
38 * 0 Standard LSN0
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
39 * 1 Blockmap
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
40 * 2-17 Boot area (as on track 35 of CoCo disk).
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
41 * 18 Begining of root dir
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
42 * 19+ Continuation of root dir ? and data sectors.
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
43 *
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
44 * Note as a limitation of this scheme, is that disks with more than 2048
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
45 * sectors, need to have a cluster size of 2 as only one sector is available
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
46 * for the block map.
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
47 *
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
48 * To format a floppy with dragon format, you need to use the command line
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
49 * parameter 'FD' (format, Dragon).
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
50 *
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
51 * 2005-10-26 P.Harvey-Smith
1899
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
52 * Determined the purpose and commented some of the unknown memory vars,
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
53 * also renamed others to more closeley represent their purpose, e.g.
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
54 * there where two 'cluster size' vars, one was inface number of bytes in
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
55 * bitmap, so that got renamed :)
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
56 * Format can now correctly build a DragonData OS-9 compatible disk
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
57 * that can have (under OS-9) cobbler run on it, and will subsequently then
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
58 * boot.
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
59 *
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
60 * 25 2005-10-26 Boisy G. Pitre
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
61 * Fixed an issue where the bitmap sector wasn't being properly set up
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
62 * due to some incorrect assumptions. The result was that copying a file
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
63 * to a newly formatted hard drive would, in cases where the drive was
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
64 * large, wipe out the bitmap sector and root directory area.
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
65
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
66 nam Format
1697
cc8ef69d1943 Format now has rolling track output
boisy
parents: 1683
diff changeset
67 ttl RBF Disk format program
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
68
312
b6c34acda06c Migrated from OS-9 Level Two
boisy
parents: 263
diff changeset
69 * Disassembled 02/07/17 11:00:13 by Disasm v1.6 (C) 1988 by RML
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
70
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
71 ifp1
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
72 use defsfile
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
73 endc
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
74
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
75 DOHELP set 0
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
76 DOROLL set 0
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
77
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
78 tylg set Prgrm+Objct
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
79 atrv set ReEnt+rev
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
80 rev set $00
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
81 edition set 25
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
82
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
83 mod eom,name,tylg,atrv,start,size
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
84
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
85 ********************************************************************
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
86 * begin our data area, starts on direct page
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
87 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
88
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
89 savedu rmb 2 save the u register
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
90 totsects rmb 3
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
91 tmpnum rmb 4
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
92 sectmode rmb 1
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
93 diskpath rmb 1 disk path number
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
94 currtrak rmb 2 current track on
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
95 currside rmb 2
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
96 currsect rmb 1 current sector on
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
97 sectcount rmb 2 counted sectors
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
98 trk0data rmb 2 track 0 data pointer
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
99 trkdata rmb 2 track !0 data pointer
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
100 u000E rmb 2
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
101 mfm rmb 1 denisity (double/single)
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
102 maxmfm rmb 1
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
103 tpi rmb 1
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
104 numsides rmb 1
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
105 ncyls rmb 2 total number of cylinders
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
106 u0017 rmb 1
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
107 u0018 rmb 1
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
108 sectors rmb 2 total number of sectors
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
109 sectors0 rmb 2 total number of sectors
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
110 bps rmb 1 bytes per sector (returned from SS.DSize)
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
111 dtype rmb 1 disk device type (5", 8", hard disk)
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
112 dns rmb 1 density byte
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
113 sas rmb 1 density byte
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
114 ready rmb 1 ready to proceed, skip warning
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
115 dresult rmb 2 decimal number in binary
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
116 interlv rmb 1 sector interleave value
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
117 u0022 rmb 2
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
118 clustsiz rmb 1 cluster size (specified or default)
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
119 clustspecified rmb 1 cluster size specified on command line
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
120 NumBitmapBytes rmb 2 Number of bytes in cluster allocation bitmap
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
121 u002A rmb 1
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
122 clustcnt rmb 1
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
123 NoRootFDSecs rmb 1 Number of sectors in Root FD (normally 8 ?)
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
124 NoSysSectors rmb 2 Number of Sectors at beginning of disk reserved for system
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
125 NoSysClusters rmb 2 Number of system Clusters to allocate
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
126 u0030 rmb 1
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
127 u0031 rmb 1
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
128 u0032 rmb 1
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
129 u0033 rmb 1
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
130 u0034 rmb 1
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
131 u0035 rmb 1
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
132 oksects rmb 3
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
133 u0038 rmb 2
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
134 u003A rmb 2
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
135 u003C rmb 1
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
136 u003D rmb 2
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
137 u003F rmb 2
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
138 u0041 rmb 2
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
139 u0043 rmb 1
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
140 u0044 rmb 1
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
141 dovfy rmb 1
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
142 dtentry rmb 2
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
143 u0048 rmb 1
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
144 toffs rmb 1 track offset (derived from PD.SToff)
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
145 soffs rmb 1 sector offset (derived from PD.SToff)
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
146 t0sngdns rmb 1 track 0 single density flag
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
147 cocofmt rmb 1 COCO disk format flag (1 = yes)
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
148 dolog rmb 1 logical format
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
149 prmbuf rmb 2
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
150 u0051 rmb 4
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
151 u0055 rmb 15
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
152 u0064 rmb 7
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
153 u006B rmb 4
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
154 dskname rmb 32 quoted delimited disk name buffer
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
155 u008F rmb 40
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
156 IsDragon rmb 1 Is this a dragon disk ?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
157 SaveRootLSN rmb 3 Saved copy of DD.DIR
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
158 AddedSysSecs rmb 2 Additional system sectors (0 for CoCo, $10 for Dragon boot area)
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
159 LSN0 rmb 256 LSN0 build buffer
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
160 optbuf rmb 256
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
161 numbuf rmb 32
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
162 fdtbuf1 rmb 3
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
163 fdtbuf2 rmb 9924
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
164 u297E rmb 451
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
165 size equ .
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
166
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
167 name fcs /Format/
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
168 fcb edition
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
169
1614
6c53cd87473a format.asm: updated
boisy
parents: 1531
diff changeset
170 *val1 fdb $0000
6c53cd87473a format.asm: updated
boisy
parents: 1531
diff changeset
171 *val2 fdb $0000
6c53cd87473a format.asm: updated
boisy
parents: 1531
diff changeset
172 *val3 fdb $0000
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
173
1707
3911533043d3 Some additional changes to address formatting 80 track drives.
boisy
parents: 1697
diff changeset
174 * Hard drive sector data: 128 bytes of $E5, and another 128 bytes of $E5
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
175 hdsdat fdb $80E5,$80E5,$0000
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
176
1707
3911533043d3 Some additional changes to address formatting 80 track drives.
boisy
parents: 1697
diff changeset
177 * Single Density Floppy Track Data
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
178 sgtdat fdb $0100,$28FF,$0600,$01FC,$0CFF,$0000
1683
786453492c1e Format doesn't multiply total sectors * bps if TYP.DSQ bit is clear
boisy
parents: 1682
diff changeset
179 * Single Density Sector Data
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
180 sgsdat fdb $0600,$01FE,$0400,$01F7,$0AFF,$0600
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
181 fdb $01FB,$80E5,$80E5,$01F7,$0AFF,$0000
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
182 fcb $FF
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
183 sgfidp fdb $0043
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
184 sgsize fdb $0128
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
185
1707
3911533043d3 Some additional changes to address formatting 80 track drives.
boisy
parents: 1697
diff changeset
186 * Double Density Floppy Track Data
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
187 dbtdat fdb $504E,$0C00,$03F6,$01FC,$204E,$0000
1683
786453492c1e Format doesn't multiply total sectors * bps if TYP.DSQ bit is clear
boisy
parents: 1682
diff changeset
188 * Double Density Sector Data
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
189 dbsdat fdb $0C00,$03F5,$01FE,$0400,$01F7,$164E
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
190 fdb $0C00,$03F5,$01FB,$80E5,$80E5,$01F7
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
191 fdb $164E,$0000
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
192 fcb $4E
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
193 dbfidp fdb $0090
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
194 dbsize fdb $0152
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
195
1721
df65b1fdea4a Added track/sector offset, fixed up sources
boisy
parents: 1707
diff changeset
196 * Double Density Color Computer Format
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
197 dctdat fdb $204E,$0000,$0C00,$03F5,$01FE,$0400
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
198 fdb $01F7,$164E,$0C00,$03F5,$01FB,$80E5
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
199 fdb $80E5,$01F7,$184E,$0000
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
200 fcb $4E
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
201 dcfidp fdb $0030
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
202 dcsize fdb $0154
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
203
2677
c58baa9276c8 Fix string constants used as numbers
William Astle <lost@l-w.ca>
parents: 2108
diff changeset
204 DragonFlag equ 'd Flag that we are formatting dragon formatted disk.
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
205 DragonRootSec equ $12 Dragon root sector is always LSN 18
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
206 DragonBootSize equ $10 Size of dragon boot area
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
207
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
208 ********************************************************************
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
209 * format module execution start address
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
210 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
211
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
212 start stu <savedu save our data pointer
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
213 bsr ClrWork clear the work area
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
214 bsr OpenDev get device name and open it
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
215 lbsr Default handle all the options
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
216 lbsr GetDTyp initialize the device
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
217 lbsr Proceed
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
218 lbsr Format physically format device
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
219 lbsr InitLSN0 initialize LSN0
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
220 lbsr ReadLSN0 attempt to read back LSN0
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
221 lbsr MkBMap make bitmap sectors
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
222 lbsr MkRootFD file descriptor
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
223 ldu <dtentry device table entry
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
224 os9 I$Detach detach the device
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
225 clrb flag no error
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
226 Exit os9 F$Exit exit module
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
227
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
228 ********************************************************************
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
229 * clear our working memory area
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
230 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
231
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
232 ClrWork leay diskpath,u point to work area
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
233 pshs y save that
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
234 leay >LSN0,u get size of area
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
235 ClrOne clr ,-y clear it down
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
236 cmpy ,s at begin?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
237 bhi ClrOne not yet,
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
238 clr IsDragon,u Assume we are not formatting a dragon disk
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
239 clr AddedSysSecs,u Clear aditional system sectors
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
240 clr AddedSysSecs+1,u
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
241 puls pc,y done
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
242
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
243 ********************************************************************
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
244 * get rbf device name and open it
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
245 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
246
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
247 OpenDev lda ,x+ get char at X
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
248 cmpa #PDELIM pathlist delimiter?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
249 beq PrsPrm branch if so
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
250 BadPath ldb #E$BPNam else set bad pathname
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
251 lbra PrtError and print error
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
252 PrsPrm os9 F$PrsNam parse pathname
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
253 lbcs PrtError branch if illegal (has additional pathlist element)
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
254 lda #PDELIM get pathlist name separator
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
255 cmpa ,y another pathlist separator?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
256 beq BadPath yes, set bad pathname
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
257 sty <u0022 no, save end of pathname
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
258 leay <prmbuf,u point to pathname buffer
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
259 MovNam sta ,y+ save pathname character
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
260 lda ,x+ get next pathname character
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
261 decb decrement pathname size
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
262 bpl MovNam got full pathname?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
263 leax <prmbuf+1,u get pathname for I$Attach
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
264 lda #C$SPAC space character
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
265 sta ,y delimit pathname
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
266 clra get access mode
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
267 os9 I$Attach attach the rbf device
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
268 lbcs PrtError if error print error and exit
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
269 stu <dtentry save device table entry
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
270 ldu <savedu get data pointer
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
271 lda #PENTIR delimit pathname
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
272 ldb #C$SPAC for os9 I$Open
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
273 std ,y do it now
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
274 lda #WRITE. get access mode
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
275 leax <prmbuf,u get pathname
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
276 os9 I$Open open the rbf device
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
277 bcs Exit exit if could not open it
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
278 sta <diskpath save path number
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
279 rts return
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
280
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
281 ********************************************************************
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
282 * get geometry and options, proceed (Y/N)
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
283 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
284
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
285 Default bsr Geometry
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
286 lbsr DoOpts
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
287 * lbsr Proceed
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
288 rts
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
289
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
290 ********************************************************************
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
291 * get rbf device geometry
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
292 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
293
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
294 ssztbl fcb $1,$2,$4,$8
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
295
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
296 Geometry leax >optbuf,u status packet address
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
297 clrb SS.OPT function
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
298 os9 I$GetStt get status packet
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
299 bcs Exit exit if error
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
300 ldb PD.SID-PD.OPT,x number of surfaces
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
301 stb <numsides save it
1721
df65b1fdea4a Added track/sector offset, fixed up sources
boisy
parents: 1707
diff changeset
302 ldb PD.SToff-PD.OPT,x get track/sector offset values
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
303 beq L0143 branch if they are zero
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
304 tfr b,a yes, make copy
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
305 anda #$0F isolate track offset (lower 4 bits)
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
306 sta <toffs save it
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
307 lsrb
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
308 lsrb
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
309 lsrb
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
310 lsrb isolate sector offset
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
311 stb <soffs save it
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
312 L0143 ldb PD.DNS-PD.OPT,x density capability
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
313 stb <dns
1721
df65b1fdea4a Added track/sector offset, fixed up sources
boisy
parents: 1707
diff changeset
314 * pshs b save it
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
315 andb #DNS.MFM check double-density
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
316 stb <mfm save double-density (Yes/No)
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
317 stb <maxmfm save it again as maximum mfm
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
318 ldb <dns get saved PD.DNS byte
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
319 lsrb now 96 TPI bit is in bit pos 0
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
320 pshs b save it
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
321 andb #$01 tpi (0=48/135, 1=96)
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
322 stb <tpi save it
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
323 puls b get byte with bit shifted right once
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
324 lsrb shift original bit #2 into bit #0
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
325 andb <maxmfm AND with mfm bit (1 = MFM, 0 = FM)
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
326 stb <t0sngdns save as track 0 single density flag
1721
df65b1fdea4a Added track/sector offset, fixed up sources
boisy
parents: 1707
diff changeset
327 * puls b get original PD.DNS byte
df65b1fdea4a Added track/sector offset, fixed up sources
boisy
parents: 1707
diff changeset
328 * NOTE: We check the TYP.CCF at this point
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
329 ldb PD.TYP-PD.OPT,x disk device type
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
330 stb <dtype
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
331 andb #TYP.CCF
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
332 stb <cocofmt store it
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
333 beq L0169 branch if not CoCo format
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
334 ldb #$01
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
335 stb <soffs CoCo has a sector offset of 1
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
336 clr <toffs and no track offset
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
337 L0169 ldd PD.CYL-PD.OPT,x number of cylinders
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
338 std <ncyls save it
1721
df65b1fdea4a Added track/sector offset, fixed up sources
boisy
parents: 1707
diff changeset
339 * ldb PD.TYP-PD.OPT,x disk device type
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
340 ldb <dtype get IT.TYP byte
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
341 andb #TYPH.SSM mask out all but sector size
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
342 leay ssztbl,pcr
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
343 ldb b,y
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
344 stb <bps and save bytes per sector
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
345 ldd PD.SCT-PD.OPT,x default sectors/track
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
346 std <sectors save it
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
347 ldd PD.T0S-PD.OPT,x default sectors/track tr00,s0
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
348 std <sectors0 save it
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
349 ldb PD.ILV-PD.OPT,x sector interleave offset
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
350 stb <interlv save it
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
351 ldb PD.SAS-PD.OPT,x minimum sector allocation
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
352 stb <sas save it
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
353 ldb #$01 default cluster size
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
354 stb <clustsiz save it
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
355 stb <sectmode and sector mode
1614
6c53cd87473a format.asm: updated
boisy
parents: 1531
diff changeset
356 *** ADDED CODE -- BGP. CHECK FOR PRESENCE OF SS.DSIZE
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
357 lda <dtype get type byte
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
358 bita #TYPH.DSQ drive size query bit set?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
359 beq nogo@ no, don't bother querying the drive for its size
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
360 lda <diskpath get disk path number
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
361 ldb #SS.DSize disk size getstat
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
362 os9 I$GetStt attempt
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
363 bcs err@
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
364 sta <bps save bytes/sector
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
365 stb <sectmode
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
366 tstb LBA mode?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
367 bne chs@
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
368 tfr x,d
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
369 stb <totsects save result...
1614
6c53cd87473a format.asm: updated
boisy
parents: 1531
diff changeset
370 sty <totsects+1
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
371 bra nogo@
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
372 chs@
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
373 stx <ncyls save cylinders
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
374 stb <numsides save sides
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
375 sty <sectors save sectors/track
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
376 sty <sectors0 save sectors/track 0
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
377 nogo@
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
378 clrb no error
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
379 rts return
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
380 err@ pshs b
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
381 leax CapErr,pcr
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
382 lda #$02
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
383 ldy #100
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
384 os9 I$WritLn
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
385 puls b
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
386 lbra PrtError
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
387
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
388 ********************************************************************
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
389 * find a option and call, until all options are processed
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
390 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
391
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
392 DoOpts ldx <u0022 option buffer
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
393 L0185 leay >OptTbl,pcr point to table
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
394 bsr L019C check for match?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
395 bcs L01A5 no, match
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
396 pshs b,a save d register
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
397 ldd $02,y get offset value
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
398 leay d,y make function address
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
399 puls b,a restore d register
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
400 jsr ,y call function
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
401 bcc L0185 finished good?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
402 lbra Exit no, exit
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
403 L019C lda ,x+ get option character
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
404 L019E cmpa ,y is it in the table?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
405 bne L01A6 no, try the next one
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
406 ldb $01,y get return value
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
407 clra flag good
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
408 L01A5 rts return
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
409 L01A6 leay $04,y get next table location
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
410 tst ,y is it the end of the table?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
411 bne L019E no, try next location
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
412 coma yes, flag bad
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
413 rts return
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
414
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
415 ********************************************************************
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
416 * option command table
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
417 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
418
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
419 OptTbl
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
420 opt.1 fcc /R/
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
421 fcc /Y/
312
b6c34acda06c Migrated from OS-9 Level Two
boisy
parents: 263
diff changeset
422 fdb DoReady-opt.1
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
423 opt.2 fcc /r/
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
424 fcc /Y/
312
b6c34acda06c Migrated from OS-9 Level Two
boisy
parents: 263
diff changeset
425 fdb DoReady-opt.2
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
426 opt.3 fcc /S/
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
427 fcc / /
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
428 fdb DoDsity-opt.3
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
429 opt.4 fcc /s/
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
430 fcc / /
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
431 fdb DoDsity-opt.4
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
432 opt.5 fcc /D/
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
433 fcc /M/
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
434 fdb DoDsity-opt.5
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
435 opt.6 fcc /d/
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
436 fcc /M/
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
437 fdb DoDsity-opt.6
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
438 opt.7 fcc /"/
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
439 fcb $00
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
440 fdb DoQuote-opt.7
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
441 opt.8 fcc /:/
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
442 fcb $00
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
443 fdb DoColon-opt.8
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
444 opt.9 fcc "/"
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
445 fcb $00
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
446 fdb DoClust-opt.9
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
447 opt.10 fcc /1/
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
448 fcb $01
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
449 fdb Do1-opt.10
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
450 opt.11 fcc /2/
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
451 fcb $02
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
452 fdb Do2-opt.11
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
453 opt.12 fcc /'/
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
454 fcb 0
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
455 fdb DoSQuote-opt.12
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
456 opt.13 fcc /L/
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
457 fcb $01
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
458 fdb DoL-opt.13
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
459 opt.14 fcc /l/
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
460 fcb 01
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
461 fdb DoL-opt.14
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
462 opt.15 fcc /(/
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
463 fcb $00
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
464 fdb DoLParen-opt.15
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
465 opt.16 fcc /)/
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
466 fcb $00
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
467 fdb DoRParen-opt.16
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
468 opt.17 fcc /,/
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
469 fcb $00
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
470 fdb DoComa-opt.17
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
471 opt.18 fcb C$SPAC
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
472 fcb 00
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
473 fdb DoSpace-opt.18
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
474
2677
c58baa9276c8 Fix string constants used as numbers
William Astle <lost@l-w.ca>
parents: 2108
diff changeset
475 opt.19 fcb 'F
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
476 fcb ' '
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
477 fdb DoFormat-opt.19
2677
c58baa9276c8 Fix string constants used as numbers
William Astle <lost@l-w.ca>
parents: 2108
diff changeset
478 opt.20 fcb 'f
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
479 fcb ' '
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
480 fdb DoFormat-opt.20
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
481
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
482
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
483 fcb $00
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
484
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
485 ********************************************************************
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
486 * S/D - density; single or double
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
487 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
488
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
489 DoDsity cmpb <maxmfm compare against maximum
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
490 bgt OptAbort if greater than, abort
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
491 cmpb <t0sngdns
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
492 blt OptAbort
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
493 stb <mfm
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
494 clrb
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
495
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
496 ********************************************************************
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
497 * skip white space
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
498 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
499
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
500 DoComa
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
501 DoRParen
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
502 DoLParen
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
503 DoSpace rts
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
504
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
505 ********************************************************************
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
506 * set ready flag - skip warn messages
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
507 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
508
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
509 DoReady stb <ready set and save ready
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
510 rts return
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
511
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
512 ********************************************************************
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
513 * 1/2 - number of sides
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
514 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
515
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
516 Do2
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
517 Do1 cmpb <numsides
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
518 bgt OptAbort
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
519 stb <numsides
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
520 clrb
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
521 rts
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
522
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
523 ********************************************************************
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
524 * only do a logical format on the rbf device
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
525 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
526
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
527 DoL stb <dolog do a logical format
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
528 clrb did option
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
529 rts return
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
530
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
531 ********************************************************************
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
532 * not a option - show abort message and exit
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
533 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
534
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
535 OptAbort leax >AbortOp,pcr Option not allowed message
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
536 lbra PExit print message and exit
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
537
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
538 ********************************************************************
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
539 * double quoted option "disk name" save name in dskname
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
540 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
541
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
542 DoQuote leay <dskname,u delimited buffer
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
543 ldb #C$SPAC delimited size
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
544 koQuote lda ,x+ delimited character
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
545 cmpa #'" is end quote?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
546 beq L0221 must be done
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
547 sta ,y+ no, save character
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
548 decb decrement name size
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
549 bne KoQuote get all 32 of them or quote
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
550 L0215 ldb ,x+ next delimited character
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
551 cmpb #'" find end quote?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
552 beq L0227 yes, back up and mark it
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
553 cmpb #C$SPAC skip space character?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
554 bcc L0215 yes, get next one
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
555 bra L0227 no, mark it's end
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
556 L0221 lda #C$SPAC get space character
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
557 cmpb #C$SPAC any delimited characters?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
558 beq L022B no, mark it's end
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
559 L0227 leay -$01,y yes, back up
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
560 lda ,y get saved character
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
561 L022B adda #$80 make it negative
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
562 sta ,y mark it's end
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
563 clrb did option
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
564 rts return
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
565
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
566 ********************************************************************
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
567 * single quoted option 'number of cylinders' save number in ncyls
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
568 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
569
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
570 DoSQuote lbsr Decimal procces number of cylinders
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
571 ldd <dresult get it
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
572 std <ncyls save it
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
573 rts return
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
574
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
575 ********************************************************************
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
576 * colon quoted option :interleave value: save value in interlv
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
577 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
578
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
579 DoColon lbsr Decimal proccess interleave value
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
580 ldd <dresult get it
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
581 tsta answer out of bounds?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
582 beq L0243 no, save it
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
583 ldb #$01 yes, default size
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
584 L0243 stb <interlv save it
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
585 rts return
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
586
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
587 ********************************************************************
1899
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
588 * Format option : formatting a CoCo or a Dragon disk ?
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
589 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
590
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
591 DoFormat
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
592 lda ,x+ Get next char
2108
9bb5e68b5e0c Fixed minor source problems
boisy
parents: 2040
diff changeset
593 cmpa #'D Do a dragon disk ?
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
594 beq DoFmtDragon
2108
9bb5e68b5e0c Fixed minor source problems
boisy
parents: 2040
diff changeset
595 cmpa #'d
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
596 bne DoFmtDragon
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
597 clr IsDragon,u Mark it as a normal CoCo (or other) disk
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
598 clrb
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
599 rts
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
600
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
601 DoFmtDragon
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
602 lda #DragonFlag Mark as Dragon disk
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
603 sta IsDragon,u
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
604
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
605 ldd #DragonBootSize Setup additional system sectors
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
606 std AddedSysSecs,u
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
607
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
608 clrb
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
609 rts
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
610
1899
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
611 ********************************************************************
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
612 * quoted option /cluster size/ save size in clustsiz
952
345872d37e14 no message
johncollyer
parents: 942
diff changeset
613 * cluster size is in decimal. The number of sectors
345872d37e14 no message
johncollyer
parents: 942
diff changeset
614 * in a cluster must be a power of 2 and the number
345872d37e14 no message
johncollyer
parents: 942
diff changeset
615 * should max out at 32 for coco os9
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
616 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
617
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
618 DoClust lbsr Decimal proccess cluster size
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
619 ldd <dresult get it
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
620 tsta answer out of bounds?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
621 beq L0250 no, save it
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
622 ldb #$01 yes, default size
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
623 L0250 stb <clustsiz save it
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
624 stb <clustspecified save fact that cluster was specified
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
625 negb get two's complement
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
626 decb power of 2
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
627 andb <clustsiz in range?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
628 beq L025C yes, skip ahead
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
629 ldb #$01 no, default size
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
630 stb <clustsiz save it
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
631 L025C clrb did option
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
632 L025D rts return
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
633
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
634 ********************************************************************
1614
6c53cd87473a format.asm: updated
boisy
parents: 1531
diff changeset
635 * print title, format (Y/N), and get response
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
636 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
637
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
638 Proceed
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
639 * leax >Title,pcr coco formatter message
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
640 * lbsr PrintLn print it
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
641 tst <dtype disk type...
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
642 bmi h@
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
643 lbsr FloppySummary
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
644 bra n@
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
645 h@ lbsr HDSummary
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
646 n@ leay >optbuf,u point to option buffer
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
647 ldx PD.T0S-PD.OPT,y default sectors/track tr00,s0
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
648 tst <mfm double-density?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
649 beq L0271 no,
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
650 ldx PD.SCT-PD.OPT,y default sectors/track
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
651 L0271 stx <sectors save it
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
652 lbsr LineFD
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
653 leax >FmtMsg,pcr formatting drive message
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
654 ldy #FmtMLen length of message
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
655 lbsr Print print it
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
656 leax <prmbuf,u input buffer
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
657 tfr x,y put it in y
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
658 L0283 lda ,y+ get input
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
659 cmpa #PENTIR proceed (y/n)?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
660 bne L0283 no, wait for yes
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
661 pshs y save input pointer
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
662 lda #C$CR carriage return
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
663 sta -$01,y store it over input
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
664 lbsr PrintLn print line
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
665 puls y get pointer
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
666 lda #PENTIR
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
667 sta -$01,y
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
668 lda <ready ok to proceed? ready
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
669 bne L02BC yes, were ready skip ahead
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
670 * tst <dtype is this a floppy or hard drive?
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
671 * bpl L02AB it is a floppy
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
672 * leax >HDFmt,pcr it is a hard drive
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
673 * ldy #$002A length of message
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
674 * lbsr Print print message
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
675 L02AB leax >Query,pcr query message
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
676 ldy #QueryLen length of message
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
677 lbsr Input show it and get response (Y/N)
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
678 anda #$DF make it upper case
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
679 cmpa #'Y answered yes?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
680 bne L02D5 no, check for no?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
681 L02BC tst <dtype formatting hard drive?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
682 bpl L025D no, return skip hard disk warn message
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
683 leax >HDFmt,pcr show hard disk warn message
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
684 ldy #HDFmtLen size of the message
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
685 lbsr Input show it and get response (Y/N)
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
686 anda #$DF make it upper case
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
687 cmpa #'Y answered yes?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
688 beq L025D yes, return
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
689 clrb clear error
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
690 lbra Exit exit
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
691 L02D5 clrb clear error
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
692 cmpa #'N answered no?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
693 lbeq Exit yes, exit
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
694 bra L02AB no, get a (Y/N) answer
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
695
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
696 ********************************************************************
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
697 * print usage message and return
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
698 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
699
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
700 LineFD leax >CrRtn,pcr point to line feed
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
701 PrintLn ldy #80 size of message
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
702 Print lda #$01 standard output path
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
703 os9 I$WritLn print line
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
704 rts return
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
705
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
706 ********************************************************************
1614
6c53cd87473a format.asm: updated
boisy
parents: 1531
diff changeset
707 * print message and get response
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
708 * entry: x holds data address y holds data size
1614
6c53cd87473a format.asm: updated
boisy
parents: 1531
diff changeset
709 * exit: a holds response (ascii character)
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
710 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
711
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
712 Input pshs u,y,x,b,a save registers
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
713 bsr Print print line
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
714 leax ,s get data address
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
715 ldy #$0001 data size
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
716 clra standard input
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
717 os9 I$Read read it
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
718 lbcs Exit exit on error
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
719 bsr LineFD print line feed
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
720 puls u,y,x,b,a restore stack
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
721 anda #$7F make it ascii
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
722 rts return
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
723
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
724 ********************************************************************
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
725 * get capability of the rbf device
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
726 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
727
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
728 GetDTyp leax >hdsdat,pcr assume hard drive data for now
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
729 stx <trk0data sector data pointer
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
730 ldb <dtype get disk drive type
1614
6c53cd87473a format.asm: updated
boisy
parents: 1531
diff changeset
731 bitb #TYP.HARD+TYP.NSF hard disk or non-standard type?
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
732 bne L0323 yes, branch
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
733 tst <cocofmt is this a COCO formatted disk?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
734 beq L031B branch if not
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
735 leax >dctdat,pcr point to COCO track data
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
736 bra L032D
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
737 L031B leax >sgtdat,pcr point to single density track data
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
738 tst <mfm double-density?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
739 beq L032D no, save off X
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
740 L0323 stx <trk0data
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
741 leax >dbtdat,pcr
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
742 tst <t0sngdns track 0 is single density?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
743 beq L032F branch if so
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
744 L032D stx <trk0data save as track 0 data
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
745 L032F stx <trkdata and !0 track data
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
746 tst <sectmode LBA values already in place?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
747 beq ack@
1614
6c53cd87473a format.asm: updated
boisy
parents: 1531
diff changeset
748 * Compute total sectors from C/H/S
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
749 clra
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
750 ldb <numsides get number of sides
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
751 tfr d,y
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
752 clrb D = 0
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
753 ldx <ncyls
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
754 bsr Mulbxty multiply B,X*Y
1614
6c53cd87473a format.asm: updated
boisy
parents: 1531
diff changeset
755 * B,X now is numsides * numcyls
6c53cd87473a format.asm: updated
boisy
parents: 1531
diff changeset
756 * Subtract one from B,X because t0s will be added later
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
757 exg d,x
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
758 subd #$0001
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
759 bcc L0344
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
760 leax -$01,x
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
761 L0344 exg d,x
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
762 ldy <sectors
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
763 bsr Mulbxty multiply B,X*Y
1614
6c53cd87473a format.asm: updated
boisy
parents: 1531
diff changeset
764 * B,X now is numsides * numcyls * sectors
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
765 exg d,x
1614
6c53cd87473a format.asm: updated
boisy
parents: 1531
diff changeset
766 * Add in sectors/track0
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
767 addd <sectors0
1614
6c53cd87473a format.asm: updated
boisy
parents: 1531
diff changeset
768 std <totsects+1
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
769 exg d,x
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
770 adcb #$00
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
771 stb <totsects
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
772 ack@
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
773 lda <dtype get type byte
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
774 bita #TYPH.DSQ drive size query bit set?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
775 beq mlex branch if so (we don't take bps into account here)
1614
6c53cd87473a format.asm: updated
boisy
parents: 1531
diff changeset
776 **** We now multiply totsects * the bytes per sector
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
777 dec <bps decrement bytes per sector (8=7,4=3,2=1,1=0)
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
778 beq mlex exit out ofloop if zero
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
779 ml@ lsl <totsects+2 else multiply by 2
1614
6c53cd87473a format.asm: updated
boisy
parents: 1531
diff changeset
780 rol <totsects+1
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
781 rol <totsects
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
782 lsr <bps shift out bits
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
783 tst <bps
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
784 bne ml@
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
785
1614
6c53cd87473a format.asm: updated
boisy
parents: 1531
diff changeset
786 ************************************************
1899
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
787 * Calculates the correct cluster size & size of bitmap in bytes
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
788
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
789 mlex lda #$08
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
790 pshs a
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
791 ldx <totsects+1
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
792 ldb <totsects
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
793 bsr Div24by8 divide totsects by 8
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
794 lda <clustsiz get current cluster size
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
795 pshs a save it as divisor
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
796 bsr Div24by8
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
797 tstb B = 0? (more than $FFFF bytes required ?)
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
798 beq L0374 branch if so
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
799
1614
6c53cd87473a format.asm: updated
boisy
parents: 1531
diff changeset
800 * Too small a cluster size comes here
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
801 tst <clustspecified did user specify cluster on command line?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
802 bne u@ branch if so (show error message)
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
803 lsl <clustsiz multiply by 2
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
804 bcs u@ if carry set to stop
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
805 leas 2,s else eat stack
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
806 bra mlex and continue trying
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
807 u@ leax >ClustMsg,pcr cluster size mismatch message
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
808 lbsr PrintLn print mismatch message
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
809 lbra L05B1 abort message and exit
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
810 L0374 leas $02,s
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
811 stx <NumBitmapBytes Save Size of bitmap in bytes
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
812 rts return
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
813
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
814 ********************************************************************
1899
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
815 * multiply (mlbxty B:X * Y)
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
816 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
817
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
818 Mulbxty lda #$08 make stack space
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
819 MulClr clr ,-s clear the space
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
820 deca cleared?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
821 bne MulClr no,
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
822 sty ,s
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
823 stb $02,s
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
824 stx $03,s
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
825 MulLoop ldd ,s we done?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
826 beq MulZer yes, clean up
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
827 lsra
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
828 rorb
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
829 std ,s
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
830 bcc MulNoC
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
831 ldd $03,s
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
832 addd $06,s
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
833 std $06,s
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
834 lda $02,s
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
835 adca $05,s
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
836 sta $05,s
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
837 MulNoC ldd $03,s
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
838 lslb
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
839 rola
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
840 std $03,s
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
841 lda $02,s
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
842 rola
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
843 sta $02,s
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
844 bra MulLoop continue rest
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
845 MulZer leas $05,s clean up space
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
846 puls pc,x,b pop results, return
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
847
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
848 ********************************************************************
1899
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
849 * 24 bit divide (2,s = divisor, B:X = dividend, result in B:X)
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
850 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
851
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
852 L03AE pshs x,b save X,B on stack
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
853 lsr ,s divide B:X by 2
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
854 ror $01,s
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
855 ror $02,s
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
856 puls x,b retrieve B:X
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
857 exg d,x exchange bits 15-0 in D,X
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
858 adcb #$00
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
859 adca #$00
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
860 exg d,x
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
861 adcb #$00
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
862 Div24by8 lsr $02,s
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
863 bne L03AE
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
864 rts
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
865
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
866 ********************************************************************
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
867 * format rbf device
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
868 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
869
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
870 Format tst <dolog doing a logical format?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
871 bne L03E4 yes, don't do this then
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
872 tst <dtype test for hard drive from PD.TYP
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
873 bpl L03E5 branch if floppy
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
874 leax >Both,pcr PHYSICAL and LOGICAL? message
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
875 ldy #BothLen length of message
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
876 lbsr Input print and get input
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
877 anda #$DF make it upper case
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
878 cmpa #'Y is it yes?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
879 beq L03E5 yes,
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
880 cmpa #'N is it no?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
881 bne Format no,
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
882 L03E4 rts return
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
883 L03E5 lda <diskpath device path number
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
884 ldb #SS.Reset reset device
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
885 os9 I$SetStt at track zero
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
886 lbcs Exit exit if error
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
887 ldd #$0000 get current track
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
888 std <currtrak save it
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
889 inca get current sector
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
890 sta <currsect save it
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
891 L03F8 clr <currside clear current side
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
892 L03FA bsr L045C
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
893 leax >LSN0,u point to our LSN0 buffer
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
894 ldd <currtrak
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
895 addd <u0048
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
896 tfr d,u
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
897 clrb
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
898 tst <cocofmt do we format this as a COCO disk?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
899 bne L041B branch if so
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
900 tst <mfm single density?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
901 beq L041D branch if so
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
902 tst <t0sngdns track 0 single density?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
903 bne L041B branch if not
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
904 tst <currtrak+1 is current track 0?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
905 bne L041B branch if not
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
906 tst <currside side is zero?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
907 beq L041D branch if 0
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
908 L041B orb #$02 else set side 1
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
909 L041D tst <tpi 48 tpi?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
910 beq L0423 branch if so
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
911 orb #$04 else set 96 tpi bit
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
912 L0423 lda <currside get current side
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
913 beq L0429 branch if 0
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
914 orb #$01
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
915 L0429 tfr d,y get side/density bits
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
916 lda <diskpath rbf device path number
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
917 ldb #SS.WTrk format (write) track
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
918 os9 I$SetStt do format it
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
919 lbcs Exit exit if error
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
920 ldu <savedu get u pointer
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
921 ldb <currside get current side
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
922 incb increment
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
923 stb <currside and store
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
924 cmpb <numsides compare against number of sides
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
925 bcs L03FA branch if greater than
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
926 ldd <currtrak get current track
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
927 addd #$0001 increment it
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
928 std <currtrak save it
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
929 cmpd <ncyls did all tracks?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
930 bcs L03F8 no,
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
931 rts yes, return
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
932
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
933 ********************************************************************
1683
786453492c1e Format doesn't multiply total sectors * bps if TYP.DSQ bit is clear
boisy
parents: 1682
diff changeset
934 * Writes AA bytes of BB to X (byte pairs are in tables above)
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
935 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
936
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
937 L044E ldy <u000E
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
938 L0451 ldd ,y++ get two bytes at Y
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
939 beq L046B branch if zero (end)
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
940 L0455 stb ,x+ store B at X and post increment
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
941 deca decrement count
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
942 bne L0455 continue if not done
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
943 bra L0451 else get next byte pair
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
944 L045C lda <dtype get drive's PD.TYP
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
945 bita #TYP.HARD+TYP.NSF hard disk or non-standard format?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
946 beq L046C branch if neither
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
947 ldy <trkdata point Y to track data
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
948 leax >LSN0,u point to the LSN0 buffer
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
949 bsr L0451 build LSN0 sector
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
950 L046B rts
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
951
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
952 ********************************************************************
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
953 *
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
954 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
955
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
956 L046C ldy <trkdata grab normal track data
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
957 ldb <sectors+1 get sector
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
958 tst <currtrak+1 track 0?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
959 bne L047E branch if not
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
960 tst <currside side 0?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
961 bne L047E branch if not
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
962 ldy <trk0data
1614
6c53cd87473a format.asm: updated
boisy
parents: 1531
diff changeset
963 * ldb <u001C
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
964 ldb <sectors0+1 get sectors in track 0
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
965 L047E sty <u000E
1682
e2ac12787e55 Sticking with clock2_smart for now. Also moved Robert's swread and swset to 3rdparty/utils
boisy
parents: 1677
diff changeset
966 stb <sectcount+1
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
967 stb <u0018
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
968 bsr L04EC
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
969 leax >LSN0,u
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
970 bsr L0451
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
971 sty <u000E
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
972 L0490 bsr L044E
1682
e2ac12787e55 Sticking with clock2_smart for now. Also moved Robert's swread and swset to 3rdparty/utils
boisy
parents: 1677
diff changeset
973 dec <sectcount+1
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
974 bne L0490
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
975 lda ,y+
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
976 sty <u000E
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
977 stx <u003D
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
978 leay >u297E,u
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
979 sty <dresult
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
980 tfr a,b
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
981 L04A6 std ,x++
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
982 cmpx <dresult
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
983 bcs L04A6
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
984 ldy <u000E
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
985 ldd ,y++
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
986 std <u003F
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
987 ldd ,y
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
988 std <u0041
1682
e2ac12787e55 Sticking with clock2_smart for now. Also moved Robert's swread and swset to 3rdparty/utils
boisy
parents: 1677
diff changeset
989 clr <sectcount+1
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
990 leax >LSN0,u
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
991 ldd <u003F
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
992 leay >u008F,u
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
993 L04C3 leax d,x
924
c155aac72190 Made cosmetic changes
boisy
parents: 689
diff changeset
994 ldd <currtrak+1
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
995 adda <toffs add in track offset
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
996 std ,x
1682
e2ac12787e55 Sticking with clock2_smart for now. Also moved Robert's swread and swset to 3rdparty/utils
boisy
parents: 1677
diff changeset
997 ldb <sectcount+1
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
998 lda b,y
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
999 incb
1682
e2ac12787e55 Sticking with clock2_smart for now. Also moved Robert's swread and swset to 3rdparty/utils
boisy
parents: 1677
diff changeset
1000 stb <sectcount+1
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1001 ldb <currsect
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1002 adda <soffs add in sector offset
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1003 bcs L04E5
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1004 std $02,x
1682
e2ac12787e55 Sticking with clock2_smart for now. Also moved Robert's swread and swset to 3rdparty/utils
boisy
parents: 1677
diff changeset
1005 lda <sectcount+1
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1006 cmpa <u0018
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1007 bcc L04E4
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1008 ldd <u0041
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1009 bra L04C3
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1010 L04E4 rts
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1011
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1012 ********************************************************************
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1013 *
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1014 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1015
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1016 L04E5 leax >AbortSct,pcr sector number out of range message
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1017 lbra PExit print message and exit
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1018
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1019 ********************************************************************
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1020 *
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1021 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1022
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1023 L04EC pshs y,b
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1024 tfr b,a
924
c155aac72190 Made cosmetic changes
boisy
parents: 689
diff changeset
1025 ldb <currtrak+1
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1026 cmpb #$01
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1027 bhi L0518
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1028 leax >u008F,u
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1029 leay a,x
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1030 ldb <interlv
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1031 bne L0507
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1032 L0500 leax >AbortIlv,pcr Interleave out of range message
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1033 lbra PExit print message and exit
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1034 L0507 cmpb <u0018
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1035 bhi L0500
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1036 nega
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1037 pshs y,x,b,a
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1038 clra
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1039 L050F sta ,x
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1040 inca
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1041 cmpa <u0018
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1042 bne L051A
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1043 leas $06,s
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1044 L0518 puls pc,y,b
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1045 L051A ldb <interlv
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1046 abx
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1047 cmpx $04,s
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1048 bcs L0525
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1049 ldb ,s
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1050 leax b,x
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1051 L0525 cmpx $02,s
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1052 bne L050F
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1053 leax $01,x
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1054 stx $02,s
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1055 bra L050F
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1056
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1057 ********************************************************************
1614
6c53cd87473a format.asm: updated
boisy
parents: 1531
diff changeset
1058 * initialize sector 0
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1059 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1060
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1061 InitLSN0 lbsr ClrBuf clear the sector buffer
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1062 ldd <totsects+1 get total sectors bits 15-0
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1063 std DD.TOT+1,x save
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1064 ldb <totsects get bits 23-16
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1065 stb DD.TOT,x save
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1066 ldd <sectors get sectors/track
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1067 std <DD.SPT,x save
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1068 stb DD.TKS,x save
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1069 lda <clustsiz get cluster size
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1070 sta DD.BIT+1,x save
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1071
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1072 clra
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1073 ldb <NumBitmapBytes Calculate number of bitmap sectors needed
1899
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
1074 tst <NumBitmapBytes+1 Exact multiple of sector size ?
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1075 beq L054F Yes no extra sectors needed
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1076 addd #$0001 Add extra sector for bytes at end
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1077 L054F addd #$0001
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1078 addd AddedSysSecs,u Add additional system sectors (usually 0)
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1079 std DD.DIR+1,x save directory sector
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1080
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1081 clra
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1082 tst <mfm single density?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1083 beq L0561 branch if so
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1084 ora #FMT.DNS else set double density bit
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1085 tst <t0sngdns track 0 is single density?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1086 beq L0561 branch if so
1707
3911533043d3 Some additional changes to address formatting 80 track drives.
boisy
parents: 1697
diff changeset
1087 * ora #FMT.T0DN
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1088 ora #$08
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1089 L0561 ldb <numsides get number of sides
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1090 cmpb #$01 just 1?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1091 beq L0569 branch if so
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1092 ora #FMT.SIDE else set double-sided bit
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1093 L0569 tst <tpi 48tpi?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1094 beq L056F branch if so
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1095 ora #FMT.TDNS else set 96 tpi
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1096 L056F sta <DD.FMT,x save
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1097 ldd <NumBitmapBytes get size of bitmap in bytes
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1098 std DD.MAP,x save number of bytes in allocation bit map
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1099 lda #$FF attributes
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1100 sta DD.ATT,x save
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1101 leax >LSN0+DD.DAT,u point to time buffer
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1102 os9 F$Time get current time
1614
6c53cd87473a format.asm: updated
boisy
parents: 1531
diff changeset
1103 leax >LSN0+DD.NAM,u
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1104 leay <dskname,u quote delimited disk name buffer
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1105 tst ,y name in buffer?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1106 beq L0594 branch if not
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1107 L058C lda ,y+ get character of name
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1108 sta ,x+ and save in name area of LSN0
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1109 bpl L058C
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1110 bra L05C7
1614
6c53cd87473a format.asm: updated
boisy
parents: 1531
diff changeset
1111 * Here we prompt for a disk name
312
b6c34acda06c Migrated from OS-9 Level Two
boisy
parents: 263
diff changeset
1112 L0594 leax >DName,pcr
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1113 ldy #DNameLen
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1114 lbsr Print print disk name prompt
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1115 leax >LSN0+DD.NAM,u point to new name
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1116 ldy #33 read up to 33 characters
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1117 clra
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1118 os9 I$ReadLn from standard input
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1119 bcc L05B8 branch if ok
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1120 cmpa #E$EOF end of file?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1121 bne L0594 branch if not
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1122 L05B1 leax >Aborted,pcr format aborted message
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1123 lbra PExit print message and exit
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1124 L05B8 tfr y,d copy number of chars entered into D
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1125 leax d,x point to last char + 1
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1126 clr ,-x
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1127 decb decrement chars typed
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1128 beq L0594 branch if zero (go ask again)
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1129 lda ,-x get last character
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1130 ora #$80 set hi bit
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1131 sta ,x and save
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1132 L05C7 leax >LSN0+DD.DAT,u point to time
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1133 leay <$40,x
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1134 pshs y
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1135 ldd #$0000
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1136 L05D3 addd ,x++
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1137 cmpx ,s
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1138 bcs L05D3
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1139 leas $02,s
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1140 std >LSN0+DD.DSK,u save disk ID
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1141
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1142 lda IsDragon,u Do we need to fixup for dragon ?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1143 cmpa #DragonFlag
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1144 bne Nofixup
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1145 bsr FixForDragon Adjust for Dragon disk format
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1146
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1147 NoFixup
1614
6c53cd87473a format.asm: updated
boisy
parents: 1531
diff changeset
1148 * Not sure what this code is for...
6c53cd87473a format.asm: updated
boisy
parents: 1531
diff changeset
1149 * ldd >val1,pcr
6c53cd87473a format.asm: updated
boisy
parents: 1531
diff changeset
1150 * std >u01A7,u
6c53cd87473a format.asm: updated
boisy
parents: 1531
diff changeset
1151 * ldd >val2,pcr
6c53cd87473a format.asm: updated
boisy
parents: 1531
diff changeset
1152 * std >u01A9,u
6c53cd87473a format.asm: updated
boisy
parents: 1531
diff changeset
1153 * ldd >val3,pcr
6c53cd87473a format.asm: updated
boisy
parents: 1531
diff changeset
1154 * std >u01AB,u
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1155 lda <diskpath
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1156 ldb #SS.Opt
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1157 leax >LSN0+DD.OPT,u point to disk options
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1158 os9 I$GetStt get options
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1159 ldb #SS.Reset reset head to track 0
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1160 os9 I$SetStt do it!
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1161 lbcs Exit branch if error
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1162 leax >LSN0,u point to LSN0
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1163 lbra WritSec and write it!
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1164
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1165
1899
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
1166 ********************************************************************
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
1167 * Adjust LSN0 values so we make a Dragon OS-9 compatible disk
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
1168 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1169
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1170 FixForDragon
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1171 pshs x
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1172 leax LSN0,u Point at LSN0
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1173
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1174 lda dtype,u Get disk type
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1175 bita #TYP.CCF CoCo/Dragon format disk ?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1176 beq DgnNoFix Nope, don't adjust
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1177
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1178 ldd DD.MAP,x Fixup map
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1179 cmpd #$ff Dragon disks have only one bitmap sector
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1180 bls DgnMapOK only using 1, don't adjust
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1181 lsra Divide map count by 2
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1182 rorb
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1183 std DD.MAP,x
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1184 inc DD.BIT+1,x Increment cluster size to 2
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1185
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1186 stb <clustsiz Update local cluster size var
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1187
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1188 DgnMapOK
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1189 DgnNoFix
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1190 puls x,pc
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1191
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1192
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1193 ********************************************************************
1614
6c53cd87473a format.asm: updated
boisy
parents: 1531
diff changeset
1194 * read in sector 0 of device
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1195 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1196
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1197 ReadLSN0 lda <diskpath get disk path
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1198 os9 I$Close close it
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1199 leax <prmbuf,u point to device name
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1200 lda #READ.
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1201 os9 I$Open open for read
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1202 lbcs BadSect branch if problem
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1203 sta <diskpath save new disk path
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1204 leax >LSN0,u
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1205 ldy #256
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1206 os9 I$Read read first sector
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1207 lbcs BadSect branch if problem
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1208 lda <diskpath get disk path
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1209 os9 I$Close close path to device
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1210 leax <prmbuf,u re-point to device name
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1211 lda #UPDAT.
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1212 os9 I$Open open in read/write mode
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1213 lbcs BadSect branch if error
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1214 sta <diskpath else save new disk path
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1215
1899
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
1216 * Save location of start of root directory, for later use
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1217 leax LSN0,u point to LSN0
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1218 lda DD.DIR,x Get location of root
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1219 ldx DD.DIR+1,x
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1220 sta SaveRootLSN,u Save a copy for later use
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1221 stx SaveRootLSN+1,u
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1222 rts and return
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1223
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1224 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1225 * Make Bitmap Sectors
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1226 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1227
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1228 MkBMap lda <dtype get device type in A
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1229 clr <dovfy clear verify flag
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1230 bita #TYP.HARD hard drive?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1231 beq nothd branch if not
1614
6c53cd87473a format.asm: updated
boisy
parents: 1531
diff changeset
1232 * Hard drives are asked for physical verification here
6c53cd87473a format.asm: updated
boisy
parents: 1531
diff changeset
1233 askphys leax >Verify,pcr
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1234 ldy #VerifyL
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1235 lbsr Input prompt for physical verify of hard drive
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1236 anda #$DF
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1237 cmpa #'Y yes?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1238 beq nothd branch if so
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1239 cmpa #'N no?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1240 bne askphys not not, ask again
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1241 sta <dovfy else flag that we don't want physical verify
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1242 nothd ldd <sectors0 get sectors/track at track 0
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1243 std <u0017 save
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1244 clra D = 0
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1245 clrb
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1246 sta <oksects clear OK sectors
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1247 std <oksects+1
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1248 std <currtrak clear current track
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1249 std <sectcount clear counted sectors
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1250 std <u0032
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1251 stb <u0031
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1252 sta <u003C
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1253 leax >optbuf,u
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1254 stx <u0038
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1255 lbsr ClrSec
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1256 leax 256,x
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1257 stx <u003A
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1258 clra
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1259 ldb #$01 D = 1
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1260 std <u0034
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1261 lda <clustsiz get cluster size
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1262 sta <clustcnt store in cluster counter
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1263 clr <u002A
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1264
1899
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
1265 * Calculate the number of reserved clusters at begining of disk, from
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
1266 * number of reserved sectors
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1267 clra
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1268 ldb <NumBitmapBytes Get no of sectors used by bitmap
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1269 tst <NumBitmapBytes+1 Exact number of sectors in bitmap ?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1270 beq L069D Yes : skip
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1271 addd #$0001 No : round up sector count
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1272 L069D addd #$0009 Add 8 sectors for root FD (IT.SAS) + 1 sector for LSN0
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1273 addd AddedSysSecs,u Add additional system sectors (if any)
1899
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
1274 std <NoSysSectors
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1275 std <NoSysClusters
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1276 lda <clustsiz get cluster size
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1277
1899
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
1278 * Since cluster sizes can only be a power of 2 (1,2,4,8,16 etc) we divide block count
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
1279 * by 2 until we get a carry, this gives us the cluster count
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1280
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1281 L06A4 lsra
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1282 bcs L06B5 First calculate number of system clusters
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1283 lsr <NoSysClusters
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1284 ror <NoSysClusters+1
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1285 bcc L06A4
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1286 inc <NoSysClusters+1
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1287 bne L06A4
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1288 inc <NoSysClusters
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1289 bra L06A4
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1290
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1291 L06B5
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1292 ldd <NoSysSectors
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1293 * ldd <NoSysSectors
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1294 * std <NoSysClusters Save No of clusters
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1295 * lda <clustsiz get cluster size
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1296 * mul Now work out number of system sectors
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1297 * std <NoSysSectors Save it
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1298
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1299 subd #$0001 Calculate number of sectors in root FD ?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1300 subd AddedSysSecs,u Remove additional system sectors (if any)
1899
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
1301 subb <NumBitmapBytes
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1302 sbca #$00
1899
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
1303 tst <NumBitmapBytes+1
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1304 beq L06CC
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1305 subd #$0001
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1306
1899
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
1307 L06CC stb <NoRootFDSecs
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1308
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1309 L06CE tst <dovfy do we verify?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1310 bne OutScrn no, output screen display
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1311 lda <diskpath yes, get rbf device path
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1312 leax >LSN0,u get sector buffer
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1313 ldy #256 sector size
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1314 os9 I$Read read of sector successful?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1315 bcc OutScrn yes, output screen display
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1316 os9 F$PErr no, print error message
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1317 lbsr NextSec get next sector
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1318 lda #$FF
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1319 sta <u002A
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1320 tst <u0031
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1321 bne OutScrn output screen display
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1322 ldx <u0032
1899
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
1323 cmpx <NoSysSectors
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1324 bhi OutScrn output screen display
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1325 BadSect leax >BadSectM,pcr bad system sector message
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1326 PExit lbsr PrintLn print message
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1327 clrb clear error
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1328 lbra Exit exit no error
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1329
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1330 ********************************************************************
1614
6c53cd87473a format.asm: updated
boisy
parents: 1531
diff changeset
1331 * output screen display scrolling track counter
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1332 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1333
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1334 OutScrn ldd <sectcount get counted sectors
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1335 addd #$0001 increment it
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1336 std <sectcount save counted sectors
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1337 cmpd <u0017 good sector count?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1338 bcs L0745 next segment
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1339 clr <sectcount clear counted sectors
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1340 clr <sectcount+1
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1341 tst <dovfy are we verifying?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1342 bne L073A no,
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1343 lda #C$SPAC yes, get space
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1344 pshs a save it
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1345 lda <currtrak+1 track high byte
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1346 lbsr HexDigit make it ascii
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1347 L0724 pshs b,a save two ascii digits
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1348 lda <currtrak track low byte
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1349 lbsr HexDigit make it ascii
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1350 pshs b,a save two ascii digits
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1351 lda #C$CR get CR
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1352 pshs a
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1353 tfr s,x get output from stack
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1354 ldy #$0006 length of output
1697
cc8ef69d1943 Format now has rolling track output
boisy
parents: 1683
diff changeset
1355 * lbsr Print print it
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1356 lda #$01
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1357 os9 I$Write
1697
cc8ef69d1943 Format now has rolling track output
boisy
parents: 1683
diff changeset
1358 * lda $02,s
cc8ef69d1943 Format now has rolling track output
boisy
parents: 1683
diff changeset
1359 * cmpa #$46 end of line?
cc8ef69d1943 Format now has rolling track output
boisy
parents: 1683
diff changeset
1360 * bne L0738 skip line feed
cc8ef69d1943 Format now has rolling track output
boisy
parents: 1683
diff changeset
1361 * lbsr LineFD print linefeed
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1362 L0738 leas $06,s pop output off stack
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1363 L073A ldd <currtrak get current track
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1364 addd #$0001 increment it
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1365 std <currtrak save it back
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1366 ldd <sectors get number of sectors
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1367 std <u0017 save it
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1368 L0745 dec <clustcnt decrement cluster counter
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1369 bne L075B
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1370 bsr L0784
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1371 tst <u002A
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1372 bne L0755
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1373 ldd <oksects+1 increment good sectors
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1374 addd #$0001
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1375 std <oksects+1
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1376 bcc L0755
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1377 inc <oksects
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1378 L0755 clr <u002A
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1379 lda <clustsiz get cluster size
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1380 sta <clustcnt save in cluster counter
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1381 L075B ldb <u0031
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1382 ldx <u0032
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1383 leax $01,x
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1384 bne L0764
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1385 incb
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1386 L0764 cmpb <totsects
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1387 bcs L076C
1614
6c53cd87473a format.asm: updated
boisy
parents: 1531
diff changeset
1388 cmpx <totsects+1
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1389 bcc L0773
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1390 L076C stb <u0031
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1391 stx <u0032
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1392 lbra L06CE
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1393 L0773 lda #$FF
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1394 sta <u002A
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1395 leay >optbuf,u
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1396 L077B cmpy <u0038
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1397 beq GoodSect number of good sectors summary
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1398 bsr L0784
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1399 bra L077B
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1400 L0784 ldx <u0038
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1401 lda <u002A
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1402 rora
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1403 rol ,x+
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1404 inc <u003C
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1405 lda <u003C
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1406 cmpa #$08
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1407 bcs L07A6
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1408 clr <u003C
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1409 stx <u0038
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1410 cmpx <u003A
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1411 bne L07A6
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1412 bsr WrtSecs
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1413 leax >optbuf,u
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1414 stx <u0038
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1415 lbsr ClrSec
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1416 L07A6 rts return
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1417
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1418 ********************************************************************
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1419 * convert byte to ascii hexadecimal and return it in d register
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1420 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1421
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1422 HexDigit tfr a,b get byte again
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1423 lsra shift upper digit
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1424 lsra
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1425 lsra
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1426 lsra
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1427 andb #$0F mask lower digit
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1428 addd #$3030 make it ascii
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1429 cmpa #$39 upper digit > 9
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1430 bls L07B8 no,
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1431 adda #$07 yes, make hexadecimal
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1432 L07B8 cmpb #$39 lower digit > 9
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1433 bls L07BE no,
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1434 addb #$07 yes, make hexadecimal
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1435 L07BE rts return
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1436
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1437 ********************************************************************
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1438 * number of good sectors message
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1439 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1440
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1441 GoodSect lbsr LineFD print line feed
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1442 leax >NumGood,pcr number of good sectors
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1443 ldy #NGoodLen length of message
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1444 lbsr Print print it
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1445 ldb <clustsiz get cluster size
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1446 lda <oksects get 24 bit counter
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1447 ldx <oksects+1
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1448 pshs x,a save 24 bit counter
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1449 L07D4 lsrb carry set 0xxx xxxx -> X ?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1450 bcs L07DF yes,
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1451 lsl $02,s <u0036 1 X <- nnnn nnnn X <- xxxx xxx0
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1452 rol $01,s <u0036 2 N <- nnnn nnnX N <- xxxx xxx0
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1453 rol ,s <u0036 3 N <- nnnn nnnN
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1454 bra L07D4 did all sectors?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1455 L07DF puls x,a get counted sectors
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1456 ldb #C$CR
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1457 pshs b save enter
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1458 tfr d,y get size
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1459 tfr x,d get
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1460 tfr b,a get convert byte
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1461 bsr HexDigit convert it BYTE 1
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1462 pshs b,a save in buffer
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1463 tfr x,d get convert byte
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1464 bsr HexDigit convert it BYTE 2
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1465 pshs b,a save in buffer
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1466 tfr y,d get convert byte
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1467 bsr HexDigit convert it BYTE 3
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1468 pshs b,a save it buffer
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1469 tfr s,x get output buffer
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1470 lbsr PrintLn print it
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1471 leas $07,s fix stack
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1472 rts return
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1473
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1474 ********************************************************************
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1475 * get allocation bit map and write sectors
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1476 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1477
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1478 WrtSecs
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1479 pshs y save register
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1480 clra set number
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1481 ldb #$01 bits to set
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1482 cmpd <u0034 map sector?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1483 bne L081E yes, write sector
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1484 leax >optbuf,u allocation bit map
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1485 clra get number
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1486 ldy <NoSysClusters system sectors
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1487 * tfr d,y into register
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1488 clrb first bit to set
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1489 os9 F$AllBit set allocation bit map
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1490 lbcs BadSect if there a error
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1491 L081E lbsr GetSec get sector
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1492 leax >optbuf,u allocation bit map
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1493 lbsr WritSec write sector
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1494 ldd <totsects get total sectors
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1495 cmpd <u0031 lsn sector count?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1496 bcs AdvSec advance to mapped sectors
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1497 bhi NxtSec get next sector
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1498 ldb <totsects+2 get LSB total sectors
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1499 cmpb <u0033 good sector count?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1500 bcc AdvSec advance to mapped sectors
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1501 NxtSec lbsr NextSec skip to next sector
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1502 AdvSec ldd <u0034 get mapped sectors
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1503 addd #$0001 count from one
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1504 std <u0034 save mapped sectors count
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1505 puls pc,y restore and return
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1506
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1507 ********************************************************************
1614
6c53cd87473a format.asm: updated
boisy
parents: 1531
diff changeset
1508 * create root directory file descriptor
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1509 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1510
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1511 MkRootFD lbsr GetSec get sector
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1512 leax >fdtbuf1,u sector buff
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1513 lbsr ClrSec clear sector
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1514 leax >fdtbuf2,u get date last modified
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1515 os9 F$Time get system time
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1516 leax >fdtbuf1,u get file descriptor
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1517 lda #DIR.+PEXEC.+PWRIT.+PREAD.+EXEC.+UPDAT.
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1518 sta FD.ATT,x save in FD.ATT
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1519 lda #$02 get link count
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1520 sta FD.LNK,x save in FD.LNK
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1521 clra directory size
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1522 ldb #DIR.SZ*2 directory entries (DIR.SZ*2)
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1523 std FD.SIZ+2,x save it (FD.SIZ+2)
1899
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
1524 ldb <NoRootFDSecs
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1525 decb
1899
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
1526 stb <FD.SEG+FDSL.B+1,x save it (c+FDSL.B+1)
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
1527 * ldd <u0034
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1528
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1529 ldd SaveRootLSN+1,u Get saved root dir LSN
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1530
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1531 addd #$0001
1899
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
1532 std <FD.SEG+FDSL.A+1,x save it (FD.SEG+FDSL.A+1)
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1533 bsr SeekRootLSN
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1534 bsr WritSec
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1535 bsr ClrBuf
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1536 ldd #$2EAE (#'.*256+'.+128)
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1537 std DIR.NM,x (DIR.NM)
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1538 stb <DIR.SZ+DIR.NM,x (DIR.NM+DIR.SZ)
1899
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
1539 * ldd <u0034
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1540
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1541 ldd SaveRootLSN+1,u Get saved root dir LSN
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1542
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1543 std <DIR.FD+1,x
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1544 std <DIR.SZ+DIR.FD+1,x
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1545 bsr WritSec
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1546 bsr ClrBuf
1899
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
1547 ldb <NoRootFDSecs
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1548 decb make zero offset (0 - 255)
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1549 NextCnt decb decrement sector count
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1550 bne NextWrt if more to do
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1551 rts else return
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1552 NextWrt pshs b save sector count
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1553 bsr WritSec write the sector
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1554 puls b get count back
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1555 bra NextCnt do until done
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1556
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1557 ********************************************************************
1899
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
1558 * Get root dir first LSN
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
1559 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1560
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1561 *GetRootLSN
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1562 * pshs x Retrieve start of Dir from LSN0
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1563 * leax LSN0,u
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1564 * ldd DD.DIR+1,x
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1565 * puls x
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1566 *
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1567 * rts
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1568
1899
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
1569 ********************************************************************
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
1570 * Seek to Root LSN
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
1571 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1572
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1573 SeekRootLSN
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1574 pshs d,x,u
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1575
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1576 ldx SaveRootLSN,u msw of pos
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1577 lda SaveRootLSN+2,u lsw
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1578 clrb
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1579 tfr d,u
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1580 lbsr SeekSec
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1581
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1582 puls d,x,u,pc
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1583
1899
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
1584 ********************************************************************
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1585 * clear the 256 byte sector buffer
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1586 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1587
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1588 ClrBuf leax >LSN0,u sector buffer
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1589 ClrSec clra store mask
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1590 clrb sector count
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1591 ClrLop sta d,x clear the buffer
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1592 decb decrement sector count
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1593 bne ClrLop clear sector buffer
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1594 rts return when done
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1595
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1596 ********************************************************************
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1597 * write physical 256 byte sector to the diskette
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1598 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1599
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1600 WritSec lda <diskpath get path number
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1601 ldy #256 get sector size
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1602 os9 I$Write write the sector
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1603 lbcs Exit exit on error
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1604 rts return
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1605
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1606 ********************************************************************
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1607 * get sector file position
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1608 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1609
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1610 GetSec clra
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1611 ldb <u0034 get map sectors high word
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1612 tfr d,x save it
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1613 lda <u0035
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1614 clrb get map sectors low word
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1615 tfr d,u save it
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1616
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1617 ********************************************************************
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1618 * seek to physical sector
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1619 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1620
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1621 SeekSec lda <diskpath get path number
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1622 os9 I$Seek seek to sector
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1623 ldu <savedu get data pointer
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1624 lbcs Exit exit if error
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1625 rts return
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1626
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1627 ********************************************************************
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1628 * skip to the next sector
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1629 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1630
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1631 NextSec ldx <u0031 lsn count
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1632 lda <u0033 good sector count
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1633 clrb add this
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1634 addd #$0100 sector
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1635 tfr d,u lsn count
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1636 bcc SeekSec seek it?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1637 leax $01,x next sector
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1638 bra SeekSec seek it
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1639
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1640 ********************************************************************
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1641 * the format module never gets to this code?
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1642 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1643
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1644 ldd ,y
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1645 leau >LSN0,u
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1646 leax >dcnums,pcr decimal number conversion table
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1647 ldy #$2F20
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1648
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1649 ********************************************************************
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1650 *
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1651 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1652
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1653 L08E6 leay >$0100,y
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1654 subd ,x
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1655 bcc L08E6
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1656 addd ,x++
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1657 pshs b,a
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1658 ldd ,x
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1659 tfr y,d
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1660 beq L090E
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1661 ldy #$2F30
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1662 cmpd #$3020
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1663 bne L0908
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1664 ldy #$2F20
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1665 tfr b,a
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1666 L0908 sta ,u+
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1667 puls b,a
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1668 bra L08E6
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1669 L090E sta ,u+
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1670 lda #C$CR
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1671 sta ,u
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1672 ldu <savedu
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1673 leas $02,s
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1674 leax >LSN0,u
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1675 lbsr PrintLn
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1676 rts
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1677
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1678 dcnums fdb 10000,1000,100,10,1,0
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1679
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1680 ********************************************************************
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1681 * process decimal number input (65535)
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1682 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1683
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1684 Decimal ldd #$0000 start at zero
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1685 L092F bsr DecBin get first digit
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1686 bcs L0939 if overflow
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1687 bne L092F get next digit
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1688 std <dresult save decimal as binary
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1689 bne L093E if no error return
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1690 L0939 ldd #$0001 flag error
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1691 std <dresult save it
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1692 L093E rts return
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1693
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1694 ********************************************************************
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1695 * process decimal number into it's binary representation
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1696 * return with binary in the d register
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1697 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1698
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1699 DecBin pshs y,b,a save registers
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1700 ldb ,x+ get digit
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1701 subb #$30 make it binary
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1702 cmpb #$0A bla bla bla!
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1703 bcc L095D
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1704 lda #$00
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1705 ldy #$000A
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1706 L094F addd ,s
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1707 bcs L095B
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1708 leay -$01,y
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1709 bne L094F
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1710 std ,s
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1711 andcc #^Zero
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1712 L095B puls pc,y,b,a
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1713 L095D orcc #Zero
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1714 puls pc,y,b,a
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1715
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1716 ********************************************************************
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1717 * print error, usage message, and exit
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1718 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1719
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1720 PrtError lda #$02 standard error
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1721 os9 F$PErr print error
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1722 ifne DOHELP
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1723 leax <HelpMsg,pcr point to usage
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1724 ldy #HelpLen usage size
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1725 lda #$02 standard error
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1726 os9 I$WritLn print usage
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1727 endc
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1728 clrb no error
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1729 os9 F$Exit exit module
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1730
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1731 ********************************************************************
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1732 * messages
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1733 ********************************************************************
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1734
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1735 *Title fcb C$LF
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1736 * fcc "COLOR COMPUTER FORMATTER"
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1737 *HelpCR fcb C$CR
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1738 ifne DOHELP
119
f418bf788bfa Disassembled format #17 from Tandy OS-9
boisy
parents: 104
diff changeset
1739 HelpMsg fcc "Use: FORMAT /devname <opts>"
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1740 fcb C$LF
312
b6c34acda06c Migrated from OS-9 Level Two
boisy
parents: 263
diff changeset
1741 fcc " opts: R - Ready"
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1742 fcb C$LF
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1743 fcc " S/D - density; single or double"
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1744 fcb C$LF
312
b6c34acda06c Migrated from OS-9 Level Two
boisy
parents: 263
diff changeset
1745 fcc " L - Logical format only"
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1746 fcb C$LF
119
f418bf788bfa Disassembled format #17 from Tandy OS-9
boisy
parents: 104
diff changeset
1747 fcc / "disk name"/
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1748 fcb C$LF
312
b6c34acda06c Migrated from OS-9 Level Two
boisy
parents: 263
diff changeset
1749 fcc " 1/2 - number of sides"
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1750 fcb C$LF
312
b6c34acda06c Migrated from OS-9 Level Two
boisy
parents: 263
diff changeset
1751 fcc " 'No. of cylinders' (in decimal)"
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1752 fcb C$LF
312
b6c34acda06c Migrated from OS-9 Level Two
boisy
parents: 263
diff changeset
1753 fcc " :Interleave value: (in decimal)"
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1754 fcb C$LF
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1755 fcc " /Cluster size/ (in decimal)"
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1756 fcb C$LF
1899
010adb3de936 Updates to allow formatting of Dragon OS-9 compatible disks
afra
parents: 1721
diff changeset
1757 fcc " FD - Dragon format disk"
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1758 fcb C$CR
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1759 HelpLen equ *-HelpMsg
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1760 endc
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1761 FmtMsg fcc "Formatting device: "
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1762 FmtMLen equ *-FmtMsg
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1763 Query
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1764 * fcc "y (yes) or n (no)"
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1765 * fcb C$LF
1682
e2ac12787e55 Sticking with clock2_smart for now. Also moved Robert's swread and swset to 3rdparty/utils
boisy
parents: 1677
diff changeset
1766 fcc "Ready? "
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1767 QueryLen equ *-Query
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1768 CapErr fcc "ABORT can't get media capacity"
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1769 fcb C$CR
312
b6c34acda06c Migrated from OS-9 Level Two
boisy
parents: 263
diff changeset
1770 AbortIlv fcc "ABORT Interleave value out of range"
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1771 fcb C$CR
312
b6c34acda06c Migrated from OS-9 Level Two
boisy
parents: 263
diff changeset
1772 AbortSct fcc "ABORT Sector number out of range"
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1773 fcb C$CR
312
b6c34acda06c Migrated from OS-9 Level Two
boisy
parents: 263
diff changeset
1774 AbortOp fcc "ABORT Option not allowed on Device"
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1775 fcb C$CR
119
f418bf788bfa Disassembled format #17 from Tandy OS-9
boisy
parents: 104
diff changeset
1776 DName fcc "Disk name: "
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1777 DNameLen equ *-DName
119
f418bf788bfa Disassembled format #17 from Tandy OS-9
boisy
parents: 104
diff changeset
1778 fcc "How many Cylinders (Tracks?) : "
926
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1779 BadSectM fcc "Bad system sector, "
ebd5b6ce665d Cluster size added by John Collyer
boisy
parents: 924
diff changeset
1780 Aborted fcc "FORMAT ABORTED"
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1781 fcb C$CR
119
f418bf788bfa Disassembled format #17 from Tandy OS-9
boisy
parents: 104
diff changeset
1782 ClustMsg fcc "Cluster size mismatch"
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1783 CrRtn fcb C$CR
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1784 * fcc "Double density? "
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1785 * fcc "Track 0 Double density? "
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1786 *TPIChg fcc "Change from 96tpi to 48tpi? "
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1787 *DSided fcc "Double sided? "
119
f418bf788bfa Disassembled format #17 from Tandy OS-9
boisy
parents: 104
diff changeset
1788 NumGood fcc "Number of good sectors: $"
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1789 NGoodLen equ *-NumGood
1683
786453492c1e Format doesn't multiply total sectors * bps if TYP.DSQ bit is clear
boisy
parents: 1682
diff changeset
1790 HDFmt fcc "This is a HARD disk - are you sure? "
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1791 *HDFmt fcc "WARNING: You are formatting a HARD Disk.."
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1792 * fcb C$LF
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1793 * fcc "Are you sure? "
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1794 HDFmtLen equ *-HDFmt
119
f418bf788bfa Disassembled format #17 from Tandy OS-9
boisy
parents: 104
diff changeset
1795 Both fcc "Both PHYSICAL and LOGICAL format? "
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1796 BothLen equ *-Both
119
f418bf788bfa Disassembled format #17 from Tandy OS-9
boisy
parents: 104
diff changeset
1797 Verify fcc "Physical Verify desired? "
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1798 VerifyL equ *-Verify
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1799 SUMH
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1800 fcb C$CR,C$LF
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1801 fcc " NitrOS-9 RBF Disk Formatter"
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1802 fcb C$CR,C$LF
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1803 fcc "------------ Format Data ------------"
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1804 fcb C$CR,C$LF
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1805 * fcb C$CR,C$LF
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1806 * fcc "Fixed values:"
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1807 fcb C$CR,C$LF
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1808 SUMHL equ *-SUMH
1721
df65b1fdea4a Added track/sector offset, fixed up sources
boisy
parents: 1707
diff changeset
1809 FMT fcc " Floppy Disk Format: "
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1810 FMTL equ *-FMT
1721
df65b1fdea4a Added track/sector offset, fixed up sources
boisy
parents: 1707
diff changeset
1811 TOF fcc " Track Offset: "
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1812 TOFL equ *-TOF
1721
df65b1fdea4a Added track/sector offset, fixed up sources
boisy
parents: 1707
diff changeset
1813 SOF fcc " Sector Offset: "
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1814 SOFL equ *-SOF
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1815 PFS fcc " Physical floppy size: "
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1816 PFSL equ *-PFS
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1817 DC fcc " Disk capacity: "
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1818 DCL equ *-DC
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1819 CSZ fcc " Cluster size: "
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1820 CSZL equ *-CSZ
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1821 *SSZ fcc " Sector size: "
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1822 *SSZL equ *-SSZ
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1823 SST fcc " Sectors/track: "
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1824 SSTL equ *-SST
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1825 TZST fcc " Track zero sect/trk: "
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1826 TZSTL equ *-TZST
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1827 *LSNOF fcc " LSN offset: $"
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1828 *LSNOFL equ *-LSNOF
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1829 TPC fcc "Total physical cylinders: "
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1830 TPCL equ *-TPC
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1831 MSA fcc " Minimum sect allocation: "
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1832 MSAL equ *-MSA
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1833 RF fcc " Recording format: "
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1834 RFL equ *-RF
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1835 TD fcc " Track density in TPI: "
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1836 TDL equ *-TD
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1837 NLC fcc "Number of log. cylinders: "
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1838 NLCL equ *-NLC
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1839 NS fcc " Number of surfaces: "
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1840 NSL equ *-NS
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1841 SI fcc "Sector interleave offset: "
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1842 SIL equ *-SI
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1843 SCTS fcc " sectors"
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1844 fcb C$CR
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1845 SPPR fcc " ("
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1846 SPPRL equ *-SPPR
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1847 PRSP fcc " bytes)"
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1848 fcb C$CR
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1849 PRSPL equ *-PRSP
2040
25b468210b37 More changes for new porting structure
boisy
parents: 1907
diff changeset
1850 _CoCo fcc !CoCo!
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1851 fcb C$CR
2040
25b468210b37 More changes for new porting structure
boisy
parents: 1907
diff changeset
1852 _Dragon fcc !Dragon!
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1853 fcb C$CR
1721
df65b1fdea4a Added track/sector offset, fixed up sources
boisy
parents: 1707
diff changeset
1854 Standard fcc !Standard OS-9!
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1855 fcb C$CR
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1856 Three5 fcc !3 1/2"!
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1857 fcb C$CR
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1858 FiveQ fcc !5 1/4"!
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1859 fcb C$CR
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1860 _MFM fcc /M/
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1861 FM fcc /FM/
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1862 fcb C$CR
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1863 TPI48 fcc /48/
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1864 fcb C$CR
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1865 TPI96 fcc !96!
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1866 fcb C$CR
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1867 TPI135 fcc !135!
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1868 fcb C$CR
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1869
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1870
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1871 HDSummary
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1872 bsr ShowHeader
1721
df65b1fdea4a Added track/sector offset, fixed up sources
boisy
parents: 1707
diff changeset
1873 lbsr ShowDiskCapacity
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1874 ldb <dtype
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1875 andb #TYPH.DSQ
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1876 bne o@
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1877 lbsr ShowSectorsTrack
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1878 lbsr ShowSectorsTrackZero
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1879 lbsr ShowNumberSurfaces
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1880 lbsr ShowTotalPhysCylinders
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1881 o@ lbsr ShowClusterSize
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1882 lbsr ShowSAS
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1883 rts
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1884
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1885 FloppySummary
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1886 bsr ShowHeader
1721
df65b1fdea4a Added track/sector offset, fixed up sources
boisy
parents: 1707
diff changeset
1887 bsr ShowDiskType
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1888 bsr ShowPhysFloppy
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1889 lbsr ShowSectorsTrack
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1890 lbsr ShowSectorsTrackZero
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1891 lbsr ShowTotalPhysCylinders
1721
df65b1fdea4a Added track/sector offset, fixed up sources
boisy
parents: 1707
diff changeset
1892 lbsr ShowTrackOffset
df65b1fdea4a Added track/sector offset, fixed up sources
boisy
parents: 1707
diff changeset
1893 lbsr ShowSectorOffset
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1894 lbsr ShowSAS
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1895 lbsr ShowRecordingFormat
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1896 lbsr ShowTrackDensity
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1897 lbsr ShowNumberLogCylinders
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1898 lbsr ShowNumberSurfaces
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1899 lbsr ShowSectorInterleaveOffset
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1900 rts
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1901
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1902 ShowHeader
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1903 lda #$01
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1904 leax SUMH,pcr
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1905 ldy #SUMHL
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1906 os9 I$Write
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1907 rts
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1908
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1909 ShowDiskType
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1910 leax FMT,pcr
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1911 ldy #FMTL
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1912 os9 I$Write
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1913 ldb <dtype
2040
25b468210b37 More changes for new porting structure
boisy
parents: 1907
diff changeset
1914 leax _CoCo,pcr
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1915 bitb #TYP.CCF
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1916 bne n@
1721
df65b1fdea4a Added track/sector offset, fixed up sources
boisy
parents: 1707
diff changeset
1917 t@ leax Standard,pcr
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1918 bra s@
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1919 n@ ldb IsDragon,u Get dragon flag
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1920 cmpb #DragonFlag Dragon disk ?
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1921 bne s@
2040
25b468210b37 More changes for new porting structure
boisy
parents: 1907
diff changeset
1922 leax _Dragon,pcr
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1923 s@ ldy #80
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1924 os9 I$WritLn
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1925 rts
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1926
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1927 ShowPhysFloppy
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1928 leax PFS,pcr
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1929 ldy #PFSL
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1930 os9 I$Write
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1931 ldb <dtype
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1932 leax FiveQ,pcr
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1933 bitb #TYP.3
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1934 beq n@
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1935 t@ leax Three5,pcr
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1936 n@ ldy #80
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1937 os9 I$WritLn
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1938 rts
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1939
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1940 ShowDiskCapacity
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1941 leax DC,pcr
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1942 ldy #DCL
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1943 os9 I$Write
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1944 clra
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1945 ldb <totsects
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1946 std <tmpnum
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1947 ldd <totsects+1
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1948 std <tmpnum+2
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1949 leax <tmpnum,u
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1950 leay numbuf,u
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1951 lbsr itoa
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1952 * X points to buffer, Y holds size
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1953 pshs x
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1954 tfr y,d
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1955 leax d,x
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1956 * X points at character after last member
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1957 leay SCTS,pcr
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1958 go@ lda ,y+
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1959 sta ,x+
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1960 cmpa #C$CR
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1961 bne go@
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1962 puls x
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1963 ldy #80
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1964 lda #$01
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1965 os9 I$WritLn
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1966 * Put out leading spaces and (
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1967 leax SPPR,pcr
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1968 ldy #SPPRL
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1969 os9 I$Write
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1970 * Copy number from totsects
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1971 clra
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1972 ldd totsects,u
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1973 std tmpnum,u
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1974 lda totsects+2,u
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1975 clrb
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1976 std tmpnum+2,u
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1977 leax <tmpnum,u
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1978 leay numbuf,u
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1979 lbsr itoa
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1980 * X points to the ASCII number
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
1981 * Y holds length
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1982 lda #$01
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1983 os9 I$Write
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1984 leax PRSP,pcr
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1985 ldy #PRSPL
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1986 os9 I$WritLn
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1987 rts
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1988
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1989 ShowSectorsTrack
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1990 leax SST,pcr
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1991 ldy #SSTL
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1992 os9 I$Write
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1993 ldd <sectors
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1994 lbra PrintNum
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1995
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1996 ShowTrackOffset
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1997 leax TOF,pcr
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1998 ldy #TOFL
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
1999 os9 I$Write
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2000 clra
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2001 ldb <toffs
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2002 lbra PrintNum
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2003
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2004 ShowSectorOffset
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2005 leax sOF,pcr
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2006 ldy #SOFL
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2007 os9 I$Write
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2008 clra
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2009 ldb <soffs
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2010 lbra PrintNum
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2011
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2012 ShowSectorsTrackZero
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2013 leax TZST,pcr
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2014 ldy #TZSTL
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2015 os9 I$Write
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2016 ldd <sectors0
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2017 lbra PrintNum
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2018
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2019 ShowTotalPhysCylinders
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2020 leax TPC,pcr
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2021 ldy #TPCL
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2022 os9 I$Write
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2023 ldd <ncyls
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2024 lbra PrintNum
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2025
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2026 ShowClusterSize
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2027 leax CSZ,pcr
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2028 ldy #CSZL
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2029 os9 I$Write
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2030 clra
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2031 ldb <clustsiz
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2032 lbra PrintNum
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2033
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2034 ShowSAS
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2035 leax MSA,pcr
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2036 ldy #MSAL
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2037 os9 I$Write
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2038 clra
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2039 ldb <sas
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2040 lbra PrintNum
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2041
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2042 ShowRecordingFormat
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2043 leax RF,pcr
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2044 ldy #RFL
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2045 os9 I$Write
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2046 leax _MFM,pcr
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2047 tst <mfm
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2048 bne n@
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2049 leax FM,pcr
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2050 n@ ldy #80
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2051 os9 I$WritLn
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2052 rts
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2053
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2054 ShowTrackDensity
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2055 leax TD,pcr
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2056 ldy #TDL
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2057 os9 I$Write
1721
df65b1fdea4a Added track/sector offset, fixed up sources
boisy
parents: 1707
diff changeset
2058 leax TPI135,pcr
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2059 ldb <dtype
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2060 lsrb
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2061 bcs n@
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2062 x@ leax TPI48,pcr
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2063 ldb <dns
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2064 bitb #DNS.DTD
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2065 beq n@
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2066 leax TPI96,pcr
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2067 n@ ldy #80
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2068 os9 I$WritLn
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2069 rts
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2070
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2071 ShowNumberLogCylinders
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2072 leax NLC,pcr
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2073 ldy #NLCL
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2074 os9 I$Write
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2075 ldd <ncyls
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2076 lbra PrintNum
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2077
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2078 ShowNumberSurfaces
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2079 leax NS,pcr
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2080 ldy #NSL
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2081 os9 I$Write
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2082 clra
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2083 ldb <numsides
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2084 bra PrintNum
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2085
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2086 ShowSectorInterleaveOffset
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2087 leax SI,pcr
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2088 ldy #SIL
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2089 os9 I$Write
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2090 clra
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2091 ldb <interlv
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2092 bra PrintNum
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2093
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2094 * Output decimal number to stdout with CR tacked at end
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2095 * Entry: B = number
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2096 * Leading zeros are NOT printed
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2097 PrintNum
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2098 pshs d
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2099 clr ,-s
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2100 clr ,-s
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2101 leax ,s
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2102 leay numbuf,u
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2103 bsr itoa
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2104 lda #$01
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2105 os9 I$Write
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2106 leas 4,s
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2107 lbra LineFd
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2108
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2109 Base fcb $3B,$9A,$CA,$00 1,000,000,000
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2110 fcb $05,$F5,$E1,$00 100,000,000
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2111 fcb $00,$98,$96,$80 10,000,000
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2112 fcb $00,$0f,$42,$40 1,000,000
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2113 fcb $00,$01,$86,$a0 100,000
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2114 fcb $00,$00,$27,$10 10,000
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2115 fcb $00,$00,$03,$e8 1,000
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2116 fcb $00,$00,$00,$64 100
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2117 fcb $00,$00,$00,$0a 10
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2118 fcb $00,$00,$00,$01 1
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2119
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2120 * Entry:
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2121 * X = address of 24 bit value
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2122 * Y = address of buffer to hold hexadecimal number
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2123 * Exit:
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2124 * X = address of buffer holding hexadecimal number
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2125 * Y = length of number string in bytes (always 6)
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2126 *i24toha pshs y
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2127 * ldb #3
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2128 * pshs b
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2129 *a@ lda ,x
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2130 * anda #$F0
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2131 * lsra
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2132 * lsra
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2133 * lsra
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2134 * lsra
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2135 * cmpa #10
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2136 * blt o@
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2137 * adda #$41
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2138 *o@ sta ,y+
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2139 * lda ,x+
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2140 * anda #$0F
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2141 * cmpa #10
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2142 * blt p@
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2143 * adda #$41
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2144 *p@ sta ,y+
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2145 * dec ,s
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2146 * bne a@
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2147 * leas 1,s
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2148 * ldy #0006
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2149 * puls x,pc
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2150
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2151 * Entry:
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2152 * X = address of 32 bit value
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2153 * Y = address of buffer to hold number
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2154 * Exit:
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2155 * X = address of buffer holding number
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2156 * Y = length of number string in bytes
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2157 itoa pshs u,y
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2158 tfr y,u
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2159 ldb #10 max number of numbers (10^9)
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2160 pshs b save count on stack
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2161 leay Base,pcr point to base of numbers
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2162 s@ lda #$30 put #'0
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2163 sta ,u at U
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2164 s1@ bsr Sub32 ,X=,X-,Y
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2165 inc ,u
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2166 bcc s1@ if X>0, continue
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2167 bsr Add32 add back in
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2168 dec ,u+
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2169 dec ,s decrement counter
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2170 beq done@
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2171 lda ,s
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2172 cmpa #$09
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2173 beq comma@
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2174 cmpa #$06
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2175 beq comma@
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2176 cmpa #$03
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2177 bne s2@
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2178 comma@ ldb #',
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2179 stb ,u+
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2180 s2@ leay 4,y point to next
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2181 bra s@
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2182 done@ leas 1,s
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2183 * 1,234,567,890
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2184 ldb #14 length of string with commas + 1
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2185 ldx ,s++ get pointer to buffer
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2186 a@ decb
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2187 beq ex@
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2188 lda ,x+ get byte
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2189 cmpa #'0
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2190 beq a@
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2191 cmpa #',
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2192 beq a@
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2193 clra
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2194 tfr d,y transfer count into Y
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2195 v@ leax -1,x
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2196 puls u,pc
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2197 ex@ ldy #0001
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2198 bra v@
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2199
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2200 * Entry:
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2201 * X = address of 32 bit minuend
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2202 * Y = address of 32 bit subtrahend
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2203 * Exit:
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2204 * X = address of 32 bit difference
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2205 Sub32 ldd 2,x
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2206 subd 2,y
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2207 std 2,x
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2208 ldd ,x
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2209 sbcb 1,y
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2210 sbca ,y
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2211 std ,x
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2212 rts
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2213
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2214
1664
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2215 * Entry:
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2216 * X = address of 32 bit number
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2217 * Y = address of 32 bit number
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2218 * Exit:
b4b97d35fda1 Updated format to OSK type functionality
boisy
parents: 1614
diff changeset
2219 * X = address of 32 bit sum
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2220 Add32 ldd 2,x
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2221 addd 2,y
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2222 std 2,x
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2223 ldd ,x
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2224 adcb 1,y
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2225 adca ,y
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2226 std ,x
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2227 rts
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2228
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2229
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2230 ifne DOROLL
952
345872d37e14 no message
johncollyer
parents: 942
diff changeset
2231 RollMsg fcc " Recording Format: FM/MFM"
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2232 fcb C$LF
952
345872d37e14 no message
johncollyer
parents: 942
diff changeset
2233 fcc " Track density in TPI: 48/96"
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2234 fcb C$LF
952
345872d37e14 no message
johncollyer
parents: 942
diff changeset
2235 fcc " Number of Cylinders: 0000"
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2236 fcb C$LF
952
345872d37e14 no message
johncollyer
parents: 942
diff changeset
2237 fcc " Number of Surfaces: 0000"
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2238 fcb C$LF
952
345872d37e14 no message
johncollyer
parents: 942
diff changeset
2239 fcc "Sector Interleave Offset: 0000"
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2240 fcb C$LF
952
345872d37e14 no message
johncollyer
parents: 942
diff changeset
2241 fcc " Disk type: 0000"
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2242 fcb C$LF
961
53b612a9ef45 Added a conditional check to the roll message, so you can build format
johncollyer
parents: 960
diff changeset
2243 fcc " Sectors/Cluster: 0000"
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2244 fcb C$LF
952
345872d37e14 no message
johncollyer
parents: 942
diff changeset
2245 fcc " Sectors/Track: 0000"
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2246 fdb $0A0A
952
345872d37e14 no message
johncollyer
parents: 942
diff changeset
2247 fcc "Sector: 00 Track: 00 Side: 00"
1907
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2248 RollLen equ *-RollMsg
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2249 endc
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2250
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2251 emod
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2252 eom equ *
638ffc04bbd0 Fixed incorrect calculation code for bitmap sectors
boisy
parents: 1899
diff changeset
2253 end