# Memotech type 03, ie: 3.5" or 5.25", D/S, D/D, S/T
# 40 tracks, 2 sides, 16 sectors/track, 256 bytes/sector
# Bytes on the media = 2*40*16*256 = 327680
# CP/M sees 26 128 byte records per track (similar to 8" disks).
# Tracks = 327680/(26*128) = 98
# Data is in 2048 byte blocks, on track 2 onwards
# Blocks = ((98-2)*26*128)/2048 = 156, which agrees with DPB

diskdef memotech-type03
  seclen 128
  tracks 98
  sectrk 26
  blocksize 2048
  maxdir 64
  skew 1
  boottrk 2
  os 2.2
end

# Memotech type 07, ie: 3.5" or 5.25", D/S, D/D, D/T
# 80 tracks, 2 sides, 16 sectors/track, 256 bytes/sector
# Bytes on the media = 2*80*16*256 = 655360
# CP/M sees 26 128 byte records per track (similar to 8" disks).
# Tracks = 655360/(26*128) = 196
# Data is in 2048 byte blocks, on track 2 onwards
# Blocks = ((196-2)*26*128)/2048 = 315, which agrees with DPB

diskdef memotech-type07
  seclen 128
  tracks 196
  sectrk 26
  blocksize 2048
  maxdir 128
  skew 1
  boottrk 2
  os 2.2
end

# Memotech type 43, ie: 1MB Silicon Disc
# CP/M sees 26 128 byte records per track
# Note: Unlike common practice with real physical disks, with real geometry,
#       the DPB for Silicon Discs includes blocks on the last incomplete track
# Tracks = 1048576/(26*128) = 315.07
# Data is in 4096 byte blocks, on track 2 onwards
# Blocks = (1048576-2*26*128)/4096 = 254, which agrees with DPB
# Blocks = ((315-2)*26*128)/4096 = 254, so we don't need the 0.07 track
diskdef memotech-type43
  seclen 128
  tracks 315
  sectrk 26
  blocksize 4096
  maxdir 256
  skew 1
  boottrk 2
  os 2.2
end

# Memotech type 47, ie: 2MB Silicon Disc
# CP/M sees 26 128 byte records per track
# Note: Unlike common practice with real physical disks, with real geometry,
#       the DPB for Silicon Discs includes blocks on the last incomplete track
# Tracks = 2097152/(26*128) = 630.15
# Data is in 4096 byte blocks, on track 2 onwards
# Blocks = (2097152-2*26*128)/4096 = 510, which agrees with DPB
# Blocks = ((630-2)*26*128)/4096 = 510, so we don't need the 0.15 track
diskdef memotech-type47
  seclen 128
  tracks 630
  sectrk 26
  blocksize 4096
  maxdir 256
  skew 1
  boottrk 2
  os 2.2
end

# Memotech type 4B, ie: 4MB Silicon Disc
# CP/M sees 26 128 byte records per track
# Note: Unlike common practice with real physical disks, with real geometry,
#       the DPB for Silicon Discs includes blocks on the last incomplete track
# Tracks = 4194304/(26*128) = 1260.3
# Data is in 4096 byte blocks, on track 2 onwards
# Blocks = (4194304-2*26*128)/4096 = 1022, which agrees with DPB
# Blocks = ((1260-2)*26*128)/4096 = 1022, so we don't need the 0.3 track
diskdef memotech-type4B
  seclen 128
  tracks 1260
  sectrk 26
  blocksize 4096
  maxdir 512
  skew 1
  boottrk 2
  os 2.2
end

# Memotech type 4F, ie: 8MB Silicon Disc
# CP/M sees 26 128 byte records per track
# Note: Unlike common practice with real physical disks, with real geometry,
#       the DPB for Silicon Discs includes blocks on the last incomplete track
# Tracks = 8388608/(26*128) = 2520.61
# Data is in 4096 byte blocks, on track 2 onwards
# Blocks = (8388608-2*26*128)/4096 = 2046, which agrees with DPB
# Blocks = ((2520-2)*26*128)/4096 = 2045, so we need the extra 0.61 track
diskdef memotech-type4F
  seclen 128
  tracks 2521
  sectrk 26
  blocksize 4096
  maxdir 512
  skew 1
  boottrk 2
  os 2.2
end

# Memotech type 18, ie: 8MB SD Card
# CP/M sees 26 128 byte records per track
# Note: Unlike common practice with real physical disks, with real geometry,
#       the DPB for SD Cards includes blocks on the last incomplete track
# Tracks = 8388608/(26*128) = 2520.61
# Data is in 4096 byte blocks, on track 2 onwards
# Blocks = (8388608-2*26*128)/4096 = 2046, which agrees with DPB
# Blocks = ((2520-2)*26*128)/4096 = 2045, so we need the extra 0.61 track
diskdef memotech-type18
  seclen 128
  tracks 2521
  sectrk 26
  blocksize 4096
  maxdir 512
  skew 1
  boottrk 2
  os 2.2
end

# Memotech type 19, ie: 8MB SD Card
diskdef memotech-type19
  seclen 128
  tracks 2521
  sectrk 26
  blocksize 4096
  maxdir 512
  skew 1
  boottrk 2
  os 2.2
  offset 8M
end

# Memotech type 1A, ie: 8MB SD Card
diskdef memotech-type1A
  seclen 128
  tracks 2521
  sectrk 26
  blocksize 4096
  maxdir 512
  skew 1
  boottrk 2
  os 2.2
  offset 16M
end

# Memotech type 1B, ie: 8MB SD Card
diskdef memotech-type1B
  seclen 128
  tracks 2521
  sectrk 26
  blocksize 4096
  maxdir 512
  skew 1
  boottrk 2
  os 2.2
  offset 24M
end

# Memotech type 1C, ie: 8MB SD Card
diskdef memotech-type1C
  seclen 128
  tracks 2521
  sectrk 26
  blocksize 4096
  maxdir 512
  skew 1
  boottrk 2
  os 2.2
  offset 32M
end

# Memotech type 1D, ie: 8MB SD Card
diskdef memotech-type1D
  seclen 128
  tracks 2521
  sectrk 26
  blocksize 4096
  maxdir 512
  skew 1
  boottrk 2
  os 2.2
  offset 40M
end

# Memotech type 1E, ie: 8MB SD Card
diskdef memotech-type1E
  seclen 128
  tracks 2521
  sectrk 26
  blocksize 4096
  maxdir 512
  skew 1
  boottrk 2
  os 2.2
  offset 48M
end

# Memotech type 1F, ie: 8MB SD Card
diskdef memotech-type1F
  seclen 128
  tracks 2521
  sectrk 26
  blocksize 4096
  maxdir 512
  skew 1
  boottrk 2
  os 2.2
  offset 56M
end

# Memotech type 50, ie: 256KB RAM Disc
# CP/M sees 26 128 byte records per track
# Note: Unlike common practice with real physical disks, with real geometry,
#       the DPB for RAM Discs includes blocks on the last incomplete track
# Tracks = 262144/(26*128) = 78.76
# Data is in 1024 byte blocks, on track 2 onwards
# Blocks = (262144-2*26*128)/1024 = 249, which agrees with DPB 
# Blocks = ((78-2)*26*128)/1024 = 247, so we need the extra 0.76 track
diskdef memotech-type50
  seclen 128
  tracks 79
  sectrk 26
  blocksize 1024
  maxdir 64
  skew 1
  boottrk 2
  os 2.2
end

# Memotech type 51, ie: 512KB RAM Disc
# CP/M sees 26 128 byte records per track
# Note: Unlike common practice with real physical disks, with real geometry,
#       the DPB for RAM Discs includes blocks on the last incomplete track
# Tracks = 524288/(26*128) = 157.53
# Data is in 2048 byte blocks, on track 2 onwards
# Blocks = (524288-2*26*128)/2048 = 252, which agrees with DPB
# Blocks = ((157-2)*26*128)/2048 = 251, so we need the extra 0.53 track
diskdef memotech-type51
  seclen 128
  tracks 158
  sectrk 26
  blocksize 2048
  maxdir 128
  skew 1
  boottrk 2
  os 2.2
end

# Memotech type 51, as used in Italy, ie: 480KB RAM Disc
# CP/M sees 26 128 byte records per track
# Note: Unlike common practice with real physical disks, with real geometry,
#       the DPB for RAM Discs includes blocks on the last incomplete track
# Tracks = 491520/(26*128) = 147.69
# Data is in 2048 byte blocks, on track 2 onwards
# Blocks = (491520-2*26*128)/2048 = 236, which agrees with DPB
# Blocks = ((147-2)*26*128)/2048 = 235, so we need the extra 0.69 track
diskdef memotech-type51-italy
  seclen 128
  tracks 148
  sectrk 26
  blocksize 2048
  maxdir 128
  skew 1
  boottrk 2
  os 2.2
end

# Memotech type 51, after S2R64.COM, ie: 448KB RAM Disc
# CP/M sees 26 128 byte records per track
# Note: Unlike common practice with real physical disks, with real geometry,
#       the DPB for RAM Discs includes blocks on the last incomplete track
# Tracks = 458752/(26*128) = 137.84
# Data is in 2048 byte blocks, on track 2 onwards
# Blocks = (458752-2*26*128)/2048 = 220, which agrees with DPB, after S2R64.COM
# Blocks = ((137-2)*26*128)/2048 = 219, so we need the extra 0.84 track
diskdef memotech-type51-s2r64
  seclen 128
  tracks 138
  sectrk 26
  blocksize 2048
  maxdir 128
  skew 1
  boottrk 2
  os 2.2
end

# Memotech type 51, after S2R.COM, ie: 144KB RAM Disc
# CP/M sees 26 128 byte records per track
# Note: Unlike common practice with real physical disks, with real geometry,
#       the DPB for RAM Discs includes blocks on the last incomplete track
# Tracks = 147456/(26*128) = 44.3
# Data is in 2048 byte blocks, on track 2 onwards
# Blocks = (147456-2*26*128)/2048 = 68, which agrees with DPB, after S2R.COM
# Blocks = ((44-2)*26*128)/2048 = 68, so we don't need the extra 0.3 track
diskdef memotech-type51-s2r
  seclen 128
  tracks 44
  sectrk 26
  blocksize 2048
  maxdir 128
  skew 1
  boottrk 2
  os 2.2
end

# Memotech type 52, ie: 320KB RAM Disc
# Added for REMEMOTECH
# CP/M sees 26 128 byte records per track
# Note: Unlike common practice with real physical disks, with real geometry,
#       the DPB for RAM Discs includes blocks on the last incomplete track
# Tracks = 327680/(26*128) = 98.46
# Data is in 2048 byte blocks, on track 2 onwards
# Blocks = (327680-2*26*128)/2048 = 156
# Blocks = ((98-2)*26*128)/2048 = 156, so we don't need the extra 0.46 track
# This type very deliberately and conveniently exactly matches type 03
diskdef memotech-type52
  seclen 128
  tracks 98
  sectrk 26
  blocksize 2048
  maxdir 64
  skew 1
  boottrk 2
  os 2.2
end
