Skip to content

Commit f1ca11f

Browse files
authored
Merge pull request #241 from davidgiven/neo
Allow DPBs and DPHs to be defined separately.
2 parents ab9050f + 2636da0 commit f1ca11f

File tree

16 files changed

+91
-67
lines changed

16 files changed

+91
-67
lines changed

include/cpm65.inc

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@
161161
#define DPB_CKS 11 /* checksum vector size */
162162
#define DPB_OFF 13 /* number of reserved sectors */
163163

164-
.macro define_drive name, sectors, blocksize, dirents, reserved
164+
.macro define_dpb name, sectors, blocksize, dirents, reserved
165165
.if \blocksize == 1024
166166
block_shift = 3
167167
.elseif \blocksize == 2048
@@ -217,13 +217,6 @@
217217

218218
.data
219219
\name:
220-
.word 0, 0, 0, 0 ; CP/M workspace
221-
.word directory_buffer
222-
.word 1f
223-
.word 2f
224-
.word 3f
225-
226-
1:
227220
.word 0 ; unused
228221
.byte block_shift ; block shift
229222
.byte (1<<block_shift)-1 ; block mask
@@ -235,10 +228,23 @@
235228
.word checksum_buffer_size ; checksum vector size
236229
.word \reserved ; number of reserved _sectors_ on disk
237230

231+
checksum_buffer_size_\name = checksum_buffer_size
232+
allocation_vector_size_\name = allocation_vector_size
233+
.endmacro
234+
235+
.macro define_dph name, dpb
236+
.data
237+
\name:
238+
.word 0, 0, 0, 0 ; CP/M workspace
239+
.word directory_buffer
240+
.word \dpb
241+
.word 1f
242+
.word 2f
243+
238244
NOINIT
239245

240-
2: .fill checksum_buffer_size
241-
3: .fill allocation_vector_size
246+
1: .fill checksum_buffer_size_\dpb
247+
2: .fill allocation_vector_size_\dpb
242248

243249
.endmacro
244250

src/arch/apple2e/apple2e.S

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1412,8 +1412,9 @@ mem_base: .byte __TPA0_START__@mos16hi, __TPA1_START__@mos16hi
14121412
mem_end: .byte __TPA0_END__@mos16hi, __TPA1_END__@mos16hi
14131413

14141414
; DPH for drive 0 and 1
1415-
define_drive dph, 0x42e, 1024, 64, 32
1416-
define_drive dph_b, 0x42e, 1024, 64, 32
1415+
define_dpb dpb, 0x42e, 1024, 64, 32
1416+
define_dph dph, dpb
1417+
define_dph dph_b, dpb
14171418

14181419
.section aligneddata, "ax", @nobits
14191420
disk_twos_buffer: .fill 86 ; must be aligned

src/arch/atari800/atari800.S

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,13 +1108,15 @@ mem_end: .byte 0
11081108
; 18 reserved sectors
11091109

11101110
#ifdef ATARI_HD
1111-
define_drive dph, 8190, 2048, 128, 18
1112-
define_drive dph_b, 8190, 2048, 128, 18
1111+
define_dpb atari_hd, 8190, 2048, 128, 18
1112+
define_dph dph, atari_hd
1113+
define_dph dph_b, atari_hd
11131114
#else
1114-
define_drive dph, 720, 1024, 64, 18
1115-
define_drive dph_b, 720, 1024, 64, 18
1116-
define_drive dph_c, 720, 1024, 64, 18
1117-
define_drive dph_d, 720, 1024, 64, 18
1115+
define_dpb atari_fd, 720, 1024, 64, 18
1116+
define_dph dph, atari_fd
1117+
define_dph dph_b, atari_fd
1118+
define_dph dph_c, atari_fd
1119+
define_dph dph_d, atari_fd
11181120
#endif
11191121

11201122
.section .noinit, "ax", @nobits

src/arch/bbcmicro/bbcmicro.S

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,8 @@ drvtop: .word drv_TTY
507507

508508
; DPH for drive 0 (our only drive)
509509

510-
define_drive dph, 0x600, 1024, 64, 0
510+
define_dpb dpb, 0x600, 1024, 64, 0
511+
define_dph dph, dpb
511512

512513
directory_buffer = _start
513514

src/arch/commodore/c64.S

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -993,7 +993,8 @@ mem_end: .byte __USERTPA_END__@mos16hi
993993

994994
; DPH for drive 0 (our only drive)
995995

996-
define_drive dph, 136*10, 1024, 64, 0
996+
define_dpb dpb, 136*10, 1024, 64, 0
997+
define_dph dph, dpb
997998

998999
NOINIT
9991000

src/arch/commodore/ieee488.S

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,8 +485,9 @@ directory_buffer: .fill 128
485485
disk_buffer: .fill 256
486486
buffer_dirty: .fill 1 ; non-zero if sector needs flushing
487487

488-
; DPH for drive 0 (our only drive)
488+
; DPH and DPB for drive 0 (our only drive)
489489

490-
define_drive dph, 136*10, 1024, 64, 0
490+
define_dpb dpb_1541, 136*10, 1024, 64, 0
491+
define_dph dph, dpb_1541
491492

492493

src/arch/kim-1/kim-1-iec.S

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,8 @@ zendproc
413413

414414
; DPH for drive 0 (our only drive)
415415

416-
define_drive dph0, 136*10, 1024, 64, 0
416+
define_dpb dpb, 136*10, 1024, 64, 0
417+
define_dph dph0, dpb
417418

418419
.bss
419420

src/arch/kim-1/kim-1-k1013.S

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,10 +286,11 @@ dphtab:
286286
.word dph3
287287
dphtab_end:
288288

289-
define_drive dph0, 77*52, 2048, 128, 52
290-
define_drive dph1, 77*52, 2048, 128, 52
291-
define_drive dph2, 77*52, 2048, 128, 52
292-
define_drive dph3, 77*52, 2048, 128, 52
289+
define_dpb dpb, 77*52, 2048, 128, 52
290+
define_dph dph0, dpb
291+
define_dph dph1, dpb
292+
define_dph dph2, dpb
293+
define_dph dph3, dpb
293294

294295
.bss
295296

src/arch/kim-1/kim-1-sdcard.S

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,8 @@ zendproc
202202

203203
; DPH for drives 0
204204

205-
define_drive dph0, 4096*64, 4096, 1024, 64
205+
define_dpb dpb, 4096*64, 4096, 1024, 64
206+
define_dph dph0, dpb
206207

207208
.bss
208209

src/arch/kim-1/kim-1-sdshield.S

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,10 +247,11 @@ dphtab:
247247
.word dph_floppyD
248248
dphtab_end:
249249

250-
define_drive dph_floppyA, TRACKS*SECTORS_PER_TRACK*2, 2048, 128, SECTORS_PER_TRACK*2
251-
define_drive dph_floppyB, TRACKS*SECTORS_PER_TRACK*2, 2048, 128, SECTORS_PER_TRACK*2
252-
define_drive dph_floppyC, TRACKS*SECTORS_PER_TRACK*2, 2048, 128, SECTORS_PER_TRACK*2
253-
define_drive dph_floppyD, TRACKS*SECTORS_PER_TRACK*2, 2048, 128, SECTORS_PER_TRACK*2
250+
define_dpb dpb, TRACKS*SECTORS_PER_TRACK*2, 2048, 128, SECTORS_PER_TRACK*2
251+
define_dph dph_floppyA, dpb
252+
define_dph dph_floppyB, dpb
253+
define_dph dph_floppyC, dpb
254+
define_dph dph_floppyD, dpb
254255

255256
.bss
256257

0 commit comments

Comments
 (0)