#set FirstVectorToTrack = Vector_CLIV
#set LastVectorToTrack = Vector_FindV

#set O_FileType		= &FCE	; our filetype
#set O_File_Size_Limit	= 2048	; dont load image files above this KB size
#set RO31_DynamicAreaLimit = 2048 * 1024 ;max size of DA for floppy images

; ******************* Hardware specific variables *********************
#set Track_Length_MS	= 200	; time duration of one floppy track in milliseconds
#set VIDC20_base_addr	= &3500000	;base address of VIDC20

; ********************** Our DiscRec variables ************************
#set O_DiscSigAddr	= 60	; offset ptr to Disc Sig Address
#set O_BootBlockAddr	= 64	; offset ptr to Boot Block Address
#set O_WhereToCheck	= 68	; offset ptr to check for Hugh / Nick on disc

; ********** Our internal structure variables for recording ***********
#if compile_RO == 311
			; 80 tracks, 5 sec/track, 20 bytes per recording
  #set Max_Recording_Size	= 80 * 5 * 20 * 2	; memory to allocate to disc recording
#else
			; 80 tracks, 10 sec/track, 20 bytes per recording
  #set Max_Recording_Size	= 80 * 10 * 20 * 2	; memory to allocate to disc recording
#endif

; ********** Our internal structure variables for APD / JFD ***********
#set O_sector_length	= 0	; offset in sector table entry for sector length
#set O_sector_no	= 1	; offset in sector table entry for sector no
#set O_density		= 2	; offset in sector table entry for density
#set O_time		= 3	; offset in sector table entry for time from start

#set bits_crc		= %1111 << 4	; mask for CRC bits
#set bit_ID_CRC		= %0001 << 4	; mask for ID CRC validation in sector table
#set bit_sector_CRC	= %0010 << 4	; mask for sector CRC validation in sector table
#set bit_not_found	= %0100 << 4	; mask for "Sector Not Found" in sector table
#set bit_slow_sector	= %1000 << 4	; mask indicating sector to be read at floppy speed
#set bit_DO3_data	= %0001 << 20	; mask indicating sector is DiscOp 3 data
#set bit_delta_write	= %1000 << 20	; mask indicating sector is a delta write

#set bits_sector_length	= %00001111	; mask for O_sector_length
#set bits_density	= %00001111	; mask for density


#if compile_GPU == 1
 .debug_mode_28 DCD 1,640,480,5,-1,-1		;MODE 28 C16M
#endif



.ADFFS_Help	DCB "ADFFS", 9, 9, version_string, 0
		ALIGN

#if compile_IOMD == 1
.VIDC1_MODE_defaults_VGA	; used to track the current VIDC parameters
; Type 0 MODES (VGA)    ref. RO3.11 ROM @ 140F8   /   PRM1-595
; /cvsroot/castle/RiscOS/Sources/Kernel/s/vdu/vdumodes,v
;          BPP    HBPCH     HDISP    HFPCH  VBPCH    VDISP    VFPCH         SYNC
;            HSYNC    HLBDR     HRBDR   VSYNC   VTBDR    VBBDR     PIXRATE

; VIDC_List 0,  76,  35,  8,  640,  8,   1, 3, 19, 65, 256, 81,  22, 24000, 2  ; 0
  VIDC_List 0,  76,  88, 96,  640, 96,  22, 3, 19, 16, 256, 16, 108, 32000, 2  ; 0
; VIDC_List 1,  38,  33, 60,  320, 60,   1, 3,  0, 35, 256, 36, 116, 16000, 2  ; 1
  VIDC_List 1,  38,  44, 48,  320, 48,  10, 3, 19, 16, 256, 16, 113, 16000, 2  ; 1
; VIDC_List 2,  38,  44, 48,  320, 48,  14, 3, 19, 16, 256, 16,   2,  8000, 2  ; 2
  VIDC_List 2,  38,  44, 48,  320, 48,  10, 3, 19, 16, 256, 16, 113, 16000, 2  ; 2
; VIDC_List 1,  76,  88, 96,  640, 96,  28, 3, 19, 19, 250, 19,   2, 16000, 2  ; 3
  VIDC_List 1,  76,  88, 96,  640, 96,  20, 3, 19, 19, 250, 19, 112, 32000, 2  ; 3

; VIDC_List 0,  76,  88, 96,  640, 96,  28, 3, 19, 16, 256, 16,   2, 16000, 2  ; 4
  VIDC_List 0,  76,  88, 96,  640, 96,  22, 3, 19, 16, 256, 16, 108, 32000, 2  ; 4
; VIDC_List 1,  38,  44, 48,  320, 48,  14, 3, 19, 16, 256, 16,   2,  8000, 2  ; 5
  VIDC_List 1,  38,  44, 48,  320, 48,  10, 3, 19, 16, 256, 16, 113, 16000, 2  ; 5
; VIDC_List 1,  38,  44, 48,  320, 48,  14, 3, 19, 19, 250, 19,   2,  8000, 2  ; 6
  VIDC_List 1,  38,  44, 48,  320, 48,  10, 3, 19, 19, 250, 19, 109, 16000, 2  ; 6
; VIDC_List 3,  38,  44, 48,  320, 48,  14, 3, 19, 19, 250, 19,   2,  8000, 2  ; 7
  VIDC_List 3,  38,  44, 48,  320, 48,  10, 3, 19, 19, 250, 19, 109, 16000, 2  ; 7

; VIDC_List 1,  76,  35,  8,  640,  8,   1, 3, 19, 65, 256, 81,  22, 24000, 2  ; 8
  VIDC_List 1,  76,  88, 96,  640, 96,  22, 3, 19, 16, 256, 16, 108, 32000, 2  ; 8
; VIDC_List 2,  38,  33, 60,  320, 60,   1, 3,  0, 35, 256, 36, 116, 16000, 2  ; 9
  VIDC_List 2,  38,  44, 48,  320, 48,  10, 3, 19, 16, 256, 16, 113, 16000, 2  ; 9
; VIDC_List 3,  38,  44, 48,  320, 48,  14, 3, 19, 16, 256, 16,   2,  8000, 2  ; 10
  VIDC_List 3,  38,  44, 48,  320, 48,  10, 3, 19, 16, 256, 16, 113, 16000, 2  ; 10
; VIDC_List 1,  76,  88, 96,  640, 96,  28, 3, 19, 19, 250, 19,   2, 16000, 2  ; 11
  VIDC_List 1,  76,  88, 96,  640, 96,  20, 3, 19, 19, 250, 19, 112, 32000, 2  ; 11

; VIDC_List 2,  76,  35,  8,  640,  8,   1, 3, 19, 65, 256, 81,  22, 24000, 2  ; 12
  VIDC_List 2,  76,  88, 96,  640, 96,  22, 3, 19, 16, 256, 16, 108, 32000, 2  ; 12
; VIDC_List 3,  38,  32, 60,  320, 60,   1, 3,  0, 35, 256, 36, 116, 16000, 2  ; 13
  VIDC_List 3,  38,  44, 48,  320, 48,  10, 3, 19, 16, 256, 16, 113, 16000, 2  ; 13
; VIDC_List 2,  76,  88, 96,  640, 96,  28, 3, 19, 19, 250, 19,   2, 16000, 2  ; 14
  VIDC_List 2,  76,  88, 96,  640, 96,  22, 3, 19, 19, 250, 19, 112, 32000, 2  ; 14
; VIDC_List 3,  76,  35,  8,  640,  8,   1, 3, 19, 65, 256, 81,  22, 24000, 2  ; 15
  VIDC_List 3,  76,  88, 96,  640, 96,  22, 3, 19, 16, 256, 16, 108, 32000, 2  ; 15

 VIDC_List 2, 114, 132, 96, 1056, 96,  42, 3, 19, 16, 256, 16,   2, 24000, 0  ; 16
 VIDC_List 2, 114, 132, 96, 1056, 96,  42, 3, 19, 19, 250, 19,   2, 24000, 0  ; 17
 VIDC_List 0,  56, 112,  0,  640,  0,  88, 3, 18,  0, 512,  0,   1, 24000, 0  ; 18
 VIDC_List 1,  56, 112,  0,  640,  0,  88, 3, 18,  0, 512,  0,   1, 24000, 0  ; 19

 VIDC_List 2,  56, 112,  0,  640,  0,  88, 3, 18,  0, 512,  0,   1, 24000, 0  ; 20
 VIDC_List 3,  56, 112,  0,  640,  0,  88, 3, 18,  0, 512,  0,   1, 24000, 0  ; 21
 VIDC_List 2,  76, 120,  0,  768,  0,  60, 3, 19,  0, 288,  0,   2, 16000, 0  ; 22
 VIDC_List 2,  52,  46,  2, 1152,  2,   2, 3, 43,  4, 896,  4,   0, 24000, 0  ; 23

 VIDC_List 3, 114, 132, 96, 1056, 96,  42, 3, 19, 16, 256, 16,   2, 24000, 0  ; 24
 VIDC_List 0,  96,  46,  0,  640,  0,  18, 2, 32,  0, 480,  0,  11, 25175, 3  ; 25
 VIDC_List 1,  96,  46,  0,  640,  0,  18, 2, 32,  0, 480,  0,  11, 25175, 3  ; 26
 VIDC_List 2,  96,  46,  0,  640,  0,  18, 2, 32,  0, 480,  0,  11, 25175, 3  ; 27

 VIDC_List 3,  96,  46,  0,  640,  0,  18, 2, 32,  0, 480,  0,  11, 25175, 3  ; 28
 VIDC_List 0,  72, 128,  0,  800,  0,  24, 2, 22,  0, 600,  0,   1, 36000, 0  ; 29
 VIDC_List 1,  72, 128,  0,  800,  0,  24, 2, 22,  0, 600,  0,   1, 36000, 0  ; 30
 VIDC_List 2,  72, 128,  0,  800,  0,  24, 2, 22,  0, 600,  0,   1, 36000, 0  ; 31

 VIDC_List 3,  72, 128,  0,  800,  0,  24, 2, 22,  0, 600,  0,   1, 36000, 0  ; 32
 VIDC_List 0,  76, 120,  0,  768,  0,  60, 3, 19,  0, 288,  0,   2, 16000, 0  ; 33
 VIDC_List 1,  76, 120,  0,  768,  0,  60, 3, 19,  0, 288,  0,   2, 16000, 0  ; 34
 VIDC_List 2,  76, 120,  0,  768,  0,  60, 3, 19,  0, 288,  0,   2, 16000, 0  ; 35

 VIDC_List 3,  76, 120,  0,  768,  0,  60, 3, 19,  0, 288,  0,   2, 16000, 0  ; 36
 VIDC_List 0, 118,  58,  0,  896,  0,  28, 3,  9,  0, 352,  0,   0, 24000, 2  ; 37 DTP 896x352
 VIDC_List 1, 118,  58,  0,  896,  0,  28, 3,  9,  0, 352,  0,   0, 24000, 2  ; 38 EGA std
 VIDC_List 2, 118,  58,  0,  896,  0,  28, 3,  9,  0, 352,  0,   0, 24000, 2  ; 39

 VIDC_List 3, 118,  58,  0,  896,  0,  28, 3,  9,  0, 352,  0,   0, 24000, 2  ; 40
 VIDC_List 0,  76,  36,  0,  640,  0,  16, 3,  9,  0, 352,  0,   0, 16783, 2  ; 41 EGA
 VIDC_List 1,  76,  36,  0,  640,  0,  16, 3,  9,  0, 352,  0,   0, 16783, 2  ; 42
 VIDC_List 2,  76,  36,  0,  640,  0,  16, 3,  9,  0, 352,  0,   0, 16783, 2  ; 43

 VIDC_List 0,  72, 162,  0,  640,  0, 146, 3, 34,  0, 200,  0,  25, 16000, 0  ; 44 CGA
 VIDC_List 1,  72, 162,  0,  640,  0, 146, 3, 34,  0, 200,  0,  25, 16000, 0  ; 45
 VIDC_List 2,  72, 162,  0,  640,  0, 146, 3, 34,  0, 200,  0,  25, 16000, 0  ; 46
 VIDC_List 3,  64,  62,  0,  360,  0,  46, 2, 32,  0, 480,  0,  11, 16783, 0  ; 47 PC Soft

 VIDC_List 2,  48,  22,  0,  320,  0,  10, 2, 32,  0, 480,  0,  11, 12587, 3  ; 48 Games mode
 VIDC_List 3,  48,  22,  0,  320,  0,  10, 2, 32,  0, 480,  0,  11, 12587, 3  ; 49 Games mode
 VIDC_List 0,  38,  44, 48,  320, 48,  14, 3, 19, 24, 240, 24,   2,  8000, 0  ; 50
 VIDC_List 1,  38,  44, 48,  320, 48,  14, 3, 19, 24, 240, 24,   2,  8000, 0  ; 51

 VIDC_List 2,  38,  44, 48,  320, 48,  14, 3, 19, 24, 240, 24,   2,  8000, 0  ; 52
 VIDC_List 3,  38,  44, 48,  320, 48,  14, 3, 19, 24, 240, 24,   2,  8000, 0  ; 53
#endif

#if compile_IOMD == 1 OR compile_GPU == 1
.VIDC1_MODE_defaults			; used to track the current VIDC parameters
; Type 0 MODES (TV)    ref. RO3.11 ROM @ 140F8
;         BPP    HBPCH      HDISP   HFPCH  VBPCH     VDISP    VFPCH        SYNC
;            HSYNC    HLBDR    HRBDR    VSYNC   VTBDR    VBBDR    PIXRATE       MODE
 VIDC_List 0,  76,  88, 96,  640, 96,  28, 3, 19, 16, 256, 16,   2, 16000, 0  ; 0
 VIDC_List 1,  38,  44, 48,  320, 48,  14, 3, 19, 16, 256, 16,   2,  8000, 0  ; 1
 VIDC_List 2,  38,  44, 48,  320, 48,  14, 3, 19, 16, 256, 16,   2,  8000, 0  ; 2
 VIDC_List 1,  76,  88, 96,  640, 96,  28, 3, 19, 19, 250, 19,   2, 16000, 0  ; 3

 VIDC_List 0,  38,  44, 48,  320, 48,  14, 3, 19, 16, 256, 16,   2,  8000, 0  ; 4
 VIDC_List 1,  38,  44, 48,  320, 48,  14, 3, 19, 16, 256, 16,   2,  8000, 0  ; 5
 VIDC_List 1,  38,  44, 48,  320, 48,  14, 3, 19, 19, 250, 19,   2,  8000, 0  ; 6
 VIDC_List 3,  38,  44, 48,  640, 48,  14, 3, 19, 19, 500, 19,   2,  8000, 0  ; 7

 VIDC_List 1,  76,  88, 96,  640, 96,  28, 3, 19, 16, 256, 16,   2, 16000, 0  ; 8
 VIDC_List 2,  38,  44, 48,  320, 48,  14, 3, 19, 16, 256, 16,   2,  8000, 0  ; 9
 VIDC_List 3,  38,  44, 48,  320, 48,  14, 3, 19, 16, 256, 16,   2,  8000, 0  ; 10
 VIDC_List 1,  76,  88, 96,  640, 96,  28, 3, 19, 19, 250, 19,   2, 16000, 0  ; 11

 VIDC_List 2,  76,  88, 96,  640, 96,  28, 3, 19, 16, 256, 16,   2, 16000, 0  ; 12
 VIDC_List 3,  38,  44, 48,  320, 48,  14, 3, 19, 16, 256, 16,   2,  8000, 0  ; 13
 VIDC_List 2,  76,  88, 96,  640, 96,  28, 3, 19, 19, 250, 19,   2, 16000, 0  ; 14
 VIDC_List 3,  76,  88, 96,  640, 96,  28, 3, 19, 16, 256, 16,   2, 16000, 0  ; 15

 VIDC_List 2, 114, 132, 96, 1056, 96,  42, 3, 19, 16, 256, 16,   2, 24000, 0  ; 16
 VIDC_List 2, 114, 132, 96, 1056, 96,  42, 3, 19, 19, 250, 19,   2, 24000, 0  ; 17
 VIDC_List 0,  56, 112,  0,  640,  0,  88, 3, 18,  0, 512,  0,   1, 24000, 0  ; 18
 VIDC_List 1,  56, 112,  0,  640,  0,  88, 3, 18,  0, 512,  0,   1, 24000, 0  ; 19

 VIDC_List 2,  56, 112,  0,  640,  0,  88, 3, 18,  0, 512,  0,   1, 24000, 0  ; 20
 VIDC_List 3,  56, 112,  0,  640,  0,  88, 3, 18,  0, 512,  0,   1, 24000, 0  ; 21
 VIDC_List 2,  76, 120,  0,  768,  0,  60, 3, 19,  0, 288,  0,   2, 16000, 0  ; 22
 VIDC_List 0,  52,  46,  2, 1152,  2,   2, 3, 43,  4, 896,  4,   0, 24000, 0  ; 23

 VIDC_List 3, 114, 132, 96, 1056, 96,  42, 3, 19, 16, 256, 16,   2, 24000, 0  ; 24
 VIDC_List 0,  96,  46,  0,  640,  0,  18, 2, 32,  0, 480,  0,  11, 25175, 3  ; 25
 VIDC_List 1,  96,  46,  0,  640,  0,  18, 2, 32,  0, 480,  0,  11, 25175, 3  ; 26
 VIDC_List 2,  96,  46,  0,  640,  0,  18, 2, 32,  0, 480,  0,  11, 25175, 3  ; 27

 VIDC_List 3,  96,  46,  0,  640,  0,  18, 2, 32,  0, 480,  0,  11, 25175, 3  ; 28
 VIDC_List 0,  72, 128,  0,  800,  0,  24, 2, 22,  0, 600,  0,   1, 36000, 0  ; 29
 VIDC_List 1,  72, 128,  0,  800,  0,  24, 2, 22,  0, 600,  0,   1, 36000, 0  ; 30
 VIDC_List 2,  72, 128,  0,  800,  0,  24, 2, 22,  0, 600,  0,   1, 36000, 0  ; 31

 VIDC_List 3,  72, 128,  0,  800,  0,  24, 2, 22,  0, 600,  0,   1, 36000, 0  ; 32
 VIDC_List 0,  76, 120,  0,  768,  0,  60, 3, 19,  0, 288,  0,   2, 16000, 0  ; 33
 VIDC_List 1,  76, 120,  0,  768,  0,  60, 3, 19,  0, 288,  0,   2, 16000, 0  ; 34
 VIDC_List 2,  76, 120,  0,  768,  0,  60, 3, 19,  0, 288,  0,   2, 16000, 0  ; 35

 VIDC_List 3,  76, 120,  0,  768,  0,  60, 3, 19,  0, 288,  0,   2, 16000, 0  ; 36
 VIDC_List 0, 118,  58,  0,  896,  0,  28, 3,  9,  0, 352,  0,   0, 24000, 2  ; 37 DTP 896x352
 VIDC_List 1, 118,  58,  0,  896,  0,  28, 3,  9,  0, 352,  0,   0, 24000, 2  ; 38 EGA std
 VIDC_List 2, 118,  58,  0,  896,  0,  28, 3,  9,  0, 352,  0,   0, 24000, 2  ; 39

 VIDC_List 3, 118,  58,  0,  896,  0,  28, 3,  9,  0, 352,  0,   0, 24000, 2  ; 40
 VIDC_List 0,  76,  36,  0,  640,  0,  16, 3,  9,  0, 352,  0,   0, 16783, 2  ; 41 EGA
 VIDC_List 1,  76,  36,  0,  640,  0,  16, 3,  9,  0, 352,  0,   0, 16783, 2  ; 42
 VIDC_List 2,  76,  36,  0,  640,  0,  16, 3,  9,  0, 352,  0,   0, 16783, 2  ; 43

 VIDC_List 0,  72, 162,  0,  640,  0, 146, 3, 34,  0, 200,  0,  25, 16000, 0  ; 44 CGA
 VIDC_List 1,  72, 162,  0,  640,  0, 146, 3, 34,  0, 200,  0,  25, 16000, 0  ; 45
 VIDC_List 2,  72, 162,  0,  640,  0, 146, 3, 34,  0, 200,  0,  25, 16000, 0  ; 46
 VIDC_List 3,  64,  62,  0,  360,  0,  46, 2, 32,  0, 480,  0,  11, 16783, 0  ; 47 PC Soft

 VIDC_List 2,  48,  22,  0,  320,  0,  10, 2, 32,  0, 480,  0,  11, 12587, 3  ; 48 Games mode
 VIDC_List 3,  48,  22,  0,  320,  0,  10, 2, 32,  0, 480,  0,  11, 12587, 3  ; 49 Games mode
 VIDC_List 0,  38,  44, 48,  320, 48,  14, 3, 19, 24, 240, 24,   2,  8000, 0  ; 50
 VIDC_List 1,  38,  44, 48,  320, 48,  14, 3, 19, 24, 240, 24,   2,  8000, 0  ; 51

 VIDC_List 2,  38,  44, 48,  320, 48,  14, 3, 19, 24, 240, 24,   2,  8000, 0  ; 52
 VIDC_List 3,  38,  44, 48,  320, 48,  14, 3, 19, 24, 240, 24,   2,  8000, 0  ; 53

.VIDC1_RO2_MODE_defaults
; Type 0 MODES (TV)    ref. RO2.00 ROM @ F340
;         BPP    HBPCH      HDISP   HFPCH  VBPCH     VDISP    VFPCH        SYNC
;            HSYNC    HLBDR    HRBDR    VSYNC   VTBDR    VBBDR    PIXRATE       MODE
 VIDC_List 0,  74, 145, 48,  640, 48,  71, 2, 18, 18, 256, 17,   0, 16000, 0  ; 0
 VIDC_List 1,  38,  73, 24,  320, 24,  35, 2, 18, 18, 256, 17,   0,  8000, 0  ; 1
 VIDC_List 2,  38,  73, 24,  320, 24,  35, 2, 18, 18, 256, 17,   0,  8000, 0  ; 2
 VIDC_List 1,  74, 145, 48,  640, 48,  71, 2, 18, 22, 250, 19,   0, 16000, 0  ; 3
 VIDC_List 0,  74, 145, 48,  640, 48,  71, 2, 18, 18, 256, 17,   0, 16000, 0  ; 4
 VIDC_List 1,  38,  73, 24,  320, 24,  35, 2, 18, 18, 256, 17,   0,  8000, 0  ; 5
 VIDC_List 1,  38,  73, 24,  320, 24,  35, 2, 18, 22, 250, 19,   0,  8000, 0  ; 6
 VIDC_List 2,  38,  73, 24,  320, 24,  35, 2, 18, 22, 250, 19,   0,  8000, 0  ; 7
 VIDC_List 1,  74, 145, 48,  640, 48,  71, 2, 18, 18, 256, 17,   0, 16000, 0  ; 8
 VIDC_List 2,  38,  73, 24,  320, 24,  35, 2, 18, 18, 256, 17,   0,  8000, 0  ; 9
 VIDC_List 3,  38,  73, 24,  320, 24,  35, 2, 18, 18, 256, 17,   0,  8000, 0  ; 10
 VIDC_List 1,  74, 145, 48,  640, 48,  71, 2, 18, 22, 250, 19,   0, 16000, 0  ; 11
 VIDC_List 2,  74, 145, 48,  640, 48,  71, 2, 18, 18, 256, 17,   0, 16000, 0  ; 12
 VIDC_List 3,  38,  73, 24,  320, 24,  35, 2, 18, 18, 256, 17,   0,  8000, 0  ; 13
 VIDC_List 2,  74, 145, 48,  640, 48,  71, 2, 18, 22, 250, 19,   0, 16000, 0  ; 14
 VIDC_List 3,  74, 145, 48,  640, 48,  71, 2, 18, 18, 256, 17,   0, 16000, 0  ; 15
 VIDC_List 2,  74, 215, 46, 1056, 46, 101, 2, 18, 18, 256, 17,   0, 24000, 0  ; 16
 VIDC_List 2,  74, 215, 46, 1056, 46, 101, 2, 18, 22, 250, 19,   0, 24000, 0  ; 17
 VIDC_List 0,  58, 183,  2,  640,  2,  13, 2, 17,  1, 512,  1,   0, 24000, 0  ; 18
 VIDC_List 1,  58, 183,  2,  640,  2,  13, 2, 17,  1, 512,  1,   0, 24000, 0  ; 19
 VIDC_List 2,  58, 183,  2,  640,  2,  13, 2, 17,  1, 512,  1,   0, 24000, 0  ; 20
 VIDC_List 3,  58, 183,  2,  640,  2,  13, 2, 17,  1, 512,  1,   0, 24000, 0  ; 21
 VIDC_List 0,  74, 145, 48,  640, 48,  71, 2, 18, 18, 256, 17,   0, 16000, 0  ; 22
 VIDC_List 2,  54,  47,  2,  288,  2,   1, 2, 43,  4, 896,  4,   0, 24000, 0  ; 23
 VIDC_List 3,  74, 215, 46, 1056, 46, 101, 2, 18, 18, 256, 17,   0, 24000, 0  ; 24
 VIDC_List 0,  92,  27,  0,  640,  0,   5, 1, 30,  2, 480,  2,   9, 24000, 0  ; 25
 VIDC_List 1,  92,  27,  0,  640,  0,   5, 1, 30,  2, 480,  2,   9, 24000, 0  ; 26
 VIDC_List 2,  92,  27,  0,  640,  0,   5, 1, 30,  2, 480,  2,   9, 24000, 0  ; 27
 VIDC_List 3,  92,  27,  0,  640,  0,   5, 1, 30,  2, 480,  2,   9, 24000, 0  ; 28

.mode_translation_table
; MODE,    X,    Y, BPP
 DCD 0,  640,  256, 0
 DCD 1,  320,  256, 1
 DCD 2,  320,  256, 2
 DCD 3,  640,  250, 0
 DCD 4,  320,  256, 0
 DCD 5,  320,  256, 1
 DCD 6,  320,  250, 1
 DCD 7,  640,  500, 3
 DCD 8,  640,  256, 1
 DCD 9,  320,  256, 2
 DCD 10, 320,  256, 3
 DCD 11, 640,  250, 1
 DCD 12, 640,  256, 2
 DCD 13, 320,  256, 3
 DCD 14, 640,  250, 2
 DCD 15, 640,  256, 3
 DCD 16, 1056, 256, 2
 DCD 17, 1056, 250, 2
 DCD 18, 640,  512, 0
 DCD 19, 640,  512, 1
 DCD 20, 640,  512, 2
 DCD 21, 640,  512, 3
 DCD 22, 768,  288, 2
 DCD 23, 1152, 896, 0
 DCD 24, 1056, 256, 3
 DCD 25, 640,  480, 0
 DCD 26, 640,  480, 1
 DCD 27, 640,  480, 2
 DCD 28, 640,  480, 3
 DCD 29, 800,  600, 0
 DCD 30, 800,  600, 1
 DCD 31, 800,  600, 2
 DCD 32, 800,  600, 3
 DCD 33, 768,  288, 0
 DCD 34, 768,  288, 1
 DCD 35, 768,  288, 2
 DCD 36, 768,  288, 3
 DCD 37, 896,  352, 0
 DCD 38, 896,  352, 1
 DCD 39, 896,  352, 2
 DCD 40, 896,  352, 3
 DCD 41, 640,  352, 0
 DCD 42, 640,  352, 1
 DCD 43, 640,  352, 2
 DCD 44, 640,  200, 0
 DCD 45, 640,  200, 1
 DCD 46, 640,  200, 2
 DCD 47, 360,  480, 3
 DCD 48, 320,  480, 2
 DCD 49, 320,  480, 3
 DCD 50, 320,  240, 0
 DCD 51, 320,  240, 1
 DCD 52, 320,  240, 2
 DCD 53, 320,  240, 3
 DCD -1

 #set last_valid_MODE = 53
 #set first_custom_MODE = 96
#endif

; bytes  sec  head density type
; 256  x 16 x 2  - 2 DD    FCE  L 640K   ADFS floppy
; 1024 x 5  x 2  - 2 DD    FCE  D 800K   ADFS floppy
; 1024 x 5  x 2  - 2 DD    FCE  E 800K   ADFS floppy
; 1024 x 10 x 2  - 4 QD    FCE  F 1.6M   ADFS floppy
; 512  x 15 x 2  - 4 QD    FC8  1.722M   DOS MultiFS disc image

.Disc_Record_L		;PRM2-204
 DCB 8			;Log2 sector size in bytes
 DCB 16			;Sectors per track
 DCB 1			;heads
 DCB 2			;density
 DCB 0			;length of id field in bits
 DCB 0			;log2 bytes per map bit
 DCB 0			;skew
 DCB 0			;bootoption
 DCB %01000000		;lowsector / bit 6 - sequenced / bit 7 - 40 track
 DCB 0			;no. of zones in the map
 DCW 0			;no. of non-allocation bits between zones
 DCD 0			;root address
 DCD 80*16*2*256	;size of disc 640K
 DCW 0			;disc_id
 DCB "          "	;disc name
 DCD &FCE		;file type given to disc
 DCD 0			;top 3e2 bits of disc size in bytes
 DCB 0			;log2 sharing granularity in sectors
 DCB 0			;bit0 partition >512MB, bits1-7 reserved
 DCB 0			;nzones_2 top 8 bits of zones in map
 DCB 0			;reserved
 DCD 0, 0, 0, 0		;reserved

 DCD 0			;offset of disc sig from start of disc in bytes
 DCD -1			;boot block address
 DCD &201		;address of Hugh / Nick


.Disc_Record_D		;PRM2-204
 DCB 10			;Log2 sector size in bytes
 DCB 5			;Sectors per track
 DCB 2			;heads
 DCB 2			;density
 DCB 0			;length of id field in bits
 DCB 0			;log2 bytes per map bit
 DCB 0			;skew
 DCB 0			;bootoption
 DCB 0			;lowsector / bit 6 - sequenced / bit 7 - 40 track
 DCB 0			;no. of zones in the map
 DCW 0			;no. of non-allocation bits between zones
 DCD 0			;root address
 DCD 80*5*2*1024	;size of disc 800K
 DCW 0			;disc_id
 DCB "          "	;disc name
 DCD &FCE		;file type given to disc
 DCD 0			;top 3e2 bits of disc size in bytes
 DCB 0			;log2 sharing granularity in sectors
 DCB 0			;bit0 partition >512MB, bits1-7 reserved
 DCB 0			;nzones_2 top 8 bits of zones in map
 DCB 0			;reserved
 DCD 0, 0, 0, 0		;reserved

 DCD 0			;offset of disc sig from start of disc in bytes
 DCD -1			;boot block address
 DCD &401		;address of Hugh / Nick


.Disc_Record_E		;PRM2-204
 DCB 10			;Log2 sector size in bytes
 DCB 5			;Sectors per track
 DCB 2			;heads
 DCB 2			;density
 DCB 15			;length of id field in bits
 DCB 7			;log2 bytes per map bit
 DCB 1			;skew
 DCB 0			;bootoption
 DCB 0			;lowsector / bit 6 - sequenced / bit 7 - 40 track
 DCB 1			;no. of zones in the map
 DCW &0520		;no. of non-allocation bits between zones (&400*8)-(1600*4)-(60*8)
 DCD &0203		;root address (&203 logical, &800 physical - &400 interleaved)
 DCD 80*5*2*1024	;size of disc 800K
 DCW 0			;disc_id
 DCB "          "	;disc name
 DCD &FCE		;file type given to disc
 DCD 0			;top 3e2 bits of disc size in bytes
 DCB 0			;log2 sharing granularity in sectors
 DCB 0			;bit0 partition >512MB, bits1-7 reserved
 DCB 0			;nzones_2 top 8 bits of zones in map
 DCB 0			;reserved
 DCD 0, 0, 0, 0		;reserved

 DCD 4			;offset of disc sig from start of disc in bytes
 DCD -1			;boot block address


.Disc_Record_F		;PRM2-204
 DCB 10			;Log2 sector size in bytes
 DCB 10			;Sectors per track
 DCB 2			;heads
 DCB 4			;density
 DCB 15			;length of id field in bits
 DCB 6			;log2 bytes per map bit
 DCB 1			;skew
 DCB 0			;bootoption
 DCB 0			;lowsector / bit 6 - sequenced / bit 7 - 40 track
 DCB 4			;no. of zones in the map
 DCW &0640		;no. of non-allocation bits between zones (&400*8)-(1600*4)-(60*8)
 DCD &0209		;root address (&209 logical, &C6A00 physical)
 DCD 80*10*2*1024	;size of disc 1600K
 DCW 0			;disc_id
 DCB "          "	;disc name
 DCD &FCE		;file type given to disc
 DCD 0			;top 3e2 bits of disc size in bytes
 DCB 0			;log2 sharing granularity in sectors
 DCB 0			;bit0 partition >512MB, bits1-7 reserved
 DCB 0			;nzones_2 top 8 bits of zones in map
 DCB 0			;reserved
 DCD 0, 0, 0, 0		;reserved

 DCD &C00 + &1C0	;offset of disc sig from start of disc in bytes
 DCD &C00		;boot block address


.Disc_Record_DOS_1440
 DCB 9			;Log2 sector size in bytes
 DCB 18			;Sectors per track
 DCB 2			;heads
 DCB 4			;density
 DCB 0			;length of id field in bits
 DCB 0			;log2 bytes per map bit
 DCB 0			;skew
 DCB 0			;bootoption
 DCB 1			;lowsector / bit 6 - sequenced / bit 7 - 40 track
 DCB 0			;no. of zones in the map
 DCW 0			;no. of non-allocation bits between zones (&400*8)-(1600*4)-(60*8)
 DCD 0			;root address (&209 logical, &C6A00 physical)
 DCD 80*18*2*512	;size of disc 1440K
 DCW 0			;disc_id
 DCB "          "	;disc name
 DCD &FC8		;file type given to disc
 DCD 0			;top 3e2 bits of disc size in bytes
 DCB 0			;log2 sharing granularity in sectors
 DCB 0			;bit0 partition >512MB, bits1-7 reserved
 DCB 0			;nzones_2 top 8 bits of zones in map
 DCB 0			;reserved
 DCD 0, 0, 0, 0		;reserved

 DCD 0			;offset of disc sig from start of disc in bytes
 DCD -1			;boot block address
 DCD &36		;address of FAT12


.Disc_Record_DOS_720
 DCB 9			;Log2 sector size in bytes
 DCB 9			;Sectors per track
 DCB 2			;heads
 DCB 2			;density
 DCB 0			;length of id field in bits
 DCB 0			;log2 bytes per map bit
 DCB 0			;skew
 DCB 0			;bootoption
 DCB 1			;lowsector / bit 6 - sequenced / bit 7 - 40 track
 DCB 0			;no. of zones in the map
 DCW 0			;no. of non-allocation bits between zones (&400*8)-(1600*4)-(60*8)
 DCD 0			;root address (&209 logical, &C6A00 physical)
 DCD 80*9*2*512		;size of disc 720K
 DCW 0			;disc_id
 DCB "          "	;disc name
 DCD &FC8		;file type given to disc
 DCD 0			;top 3e2 bits of disc size in bytes
 DCB 0			;log2 sharing granularity in sectors
 DCB 0			;bit0 partition >512MB, bits1-7 reserved
 DCB 0			;nzones_2 top 8 bits of zones in map
 DCB 0			;reserved
 DCD 0, 0, 0, 0		;reserved

 DCD 0			;offset of disc sig from start of disc in bytes
 DCD -1			;boot block address
 DCD &36		;address of FAT12


.Disc_Record_Atari_720
 DCB 9			;Log2 sector size in bytes
 DCB 9			;Sectors per track
 DCB 2			;heads
 DCB 2			;density
 DCB 0			;length of id field in bits
 DCB 0			;log2 bytes per map bit
 DCB 0			;skew
 DCB 0			;bootoption
 DCB 1			;lowsector / bit 6 - sequenced / bit 7 - 40 track
 DCB 0			;no. of zones in the map
 DCW 0			;no. of non-allocation bits between zones (&400*8)-(1600*4)-(60*8)
 DCD 0			;root address (&209 logical, &C6A00 physical)
 DCD 80*9*2*512		;size of disc 720K
 DCW 0			;disc_id
 DCB "          "	;disc name
 DCD &FE3		;file type given to disc
 DCD 0			;top 3e2 bits of disc size in bytes
 DCB 0			;log2 sharing granularity in sectors
 DCB 0			;bit0 partition >512MB, bits1-7 reserved
 DCB 0			;nzones_2 top 8 bits of zones in map
 DCB 0			;reserved
 DCD 0, 0, 0, 0		;reserved

 DCD 0			;offset of disc sig from start of disc in bytes
 DCD 0			;boot block address
 DCD 0


.Disc_Record_Atari_360
 DCB 9			;Log2 sector size in bytes
 DCB 9			;Sectors per track
 DCB 1			;heads
 DCB 2			;density
 DCB 0			;length of id field in bits
 DCB 0			;log2 bytes per map bit
 DCB 0			;skew
 DCB 0			;bootoption
 DCB %1000001		;lowsector / bit 6 - sequenced / bit 7 - 40 track
 DCB 0			;no. of zones in the map
 DCW 0			;no. of non-allocation bits between zones (&400*8)-(1600*4)-(60*8)
 DCD 0			;root address (&209 logical, &C6A00 physical)
 DCD 80*9*1*512		;size of disc 360K
 DCW 0			;disc_id
 DCB "          "	;disc name
 DCD &FE3		;file type given to disc
 DCD 0			;top 3e2 bits of disc size in bytes
 DCB 0			;log2 sharing granularity in sectors
 DCB 0			;bit0 partition >512MB, bits1-7 reserved
 DCB 0			;nzones_2 top 8 bits of zones in map
 DCB 0			;reserved
 DCD 0, 0, 0, 0		;reserved

 DCD 0			;offset of disc sig from start of disc in bytes
 DCD 0			;boot block address
 DCD 0

.ADFFS_Filer_Name	DCB "ADFS::0", 0	;ADFS drive we're using
.Read_FileSizeLimitVal	DCB "ADFFS$FileSizeLimit", 0
.Read_RecordingPath	DCB "ADFFS$RecordingPath", 0
.Set_JITStatus		DCB "ADFFS$JIT", 0
.Set_CRC		DCB "ADFFS$CRC", 0
.Set_RunTypes_entry	DCB "Obey ADFFS:!RunTypes 1", 0
.Set_RunTypes_exit	DCB "Obey ADFFS:!RunTypes 0", 0

.Essential_Modules	;Modules which must not be killed (in UPPERCASE)
 DCB 0
 DCB "SHAREDCLIBRARY", 0
 DCB "ZLIB", 0
 DCB "CALLASWI", 0
 DCB "ADFFS", 0
 DCB "MEMALLOC", 0
#if compile_RO > 311
 DCB "SOUNDDMA", 0
#endif
 DCB "ADFS", 0			;OS pre-req modules
 DCB "FILECORE%BASE", 0
 DCB "FILECORE%ADFS", 0
 DCB "FILESWITCH", 0
 DCB "MESSAGETRANS", 0
 DCB "MESSAGES", 0
 DCB "RESOURCEFS", 0
.UtilityModule DCB "UTILITYMODULE", 0
 DCB 0
 ALIGN
