home *** CD-ROM | disk | FTP | other *** search
-
- ; save as a TOS program
-
- Text
-
- Include TOS\GEMDOS.S
- Include TOS\XBIOS.S
- Include TOS\EZMAC.S
-
- Cursor Solid ;I hate the flashing cursor!
- Restart:
- Cls
- Cls
- PrintCR ' Cluster Size Changer v.2'
- PrintCR ' by'
- PrintCR ' ML & ML Software'
- CR
- PrintCR 'Change cluster size of disk in which'
- Print 'Drive (A or B, X exits)? '
- CapsIn
- Cmp.B #'B',D0
- Beq DriveOK
- Cmp.B #'A',D0
- Beq DriveOK
- Cmp.B #'X',D0
- Bne Restart
- Term
-
- DriveOK:
- Move.B D0,Char
- Move.B #0,Char+1
- VPrintCR Char ;display choice
- Move.B Char,D0 ;D0 is fried during print!
- Move.B D0,AnyFiles ;part of pathname
- Sub #'A',D0 ;D0=0 (A) or 1 (B)
- Move D0,Drive
- SFirst #0,AnyFiles ;make sure the disk is newly formatted
- Cmp.B #-33,D0 ;-33 = no files ... good!
- Bne FilesExist ;uh-oh, there are files here
-
- FlopRd #1,#0,#0,#1,Drive,Sector0 ;read sector 0
-
- CR
- CR
- CR
- PrintCR 'Cluster size on this disk:'
-
- Lea Sector0,A0
- Move.B 13(A0),D0 ;what is the current cluster size?
- Cmp.B #1,D0 ;is it 1?
- Beq SwitchTo2
- Cmp.B #2,D0 ;how about 2?
- Bne Problems ;neither? better not touch it
-
- SwitchTo1:
- PrintCR ' 2 sectors per cluster'
- Print 'Change cluster size to 1? '
- CapsIn
- Move.B D0,Char
- Move.B #0,Char+1
- VPrintCR Char ;display choice
- Cmp.B #'Y',Char ;do they want it changed?
- Bne Restart
- Lea Sector0,A0 ;need to reload A0
- Move.B #1,13(A0) ;set 1 sectors per cluster
- Bra WriteIt
-
- SwitchTo2:
- PrintCR ' 1 sector per cluster'
- Print 'Change cluster size to 2? '
- CapsIn
- Move.B D0,Char
- Move.B #0,Char+1
- VPrintCR Char ;display choice
- Cmp.B #'Y',Char ;do they want it changed?
- Bne Restart
- Lea Sector0,A0 ;reload A0
- Move.B #2,13(A0) ;set 2 sectors per cluster
-
- WriteIt:
- FlopWr #1,#0,#0,#1,Drive,Sector0 ;write sector 0
- Tst D0 ;errors?
- Bne Oops ;yep!
-
- CR
- CR
- CR
- Print 'Drive '
- Move.B AnyFiles,Drive ;copy drive letter
- Move.B #0,Drive+1
- VPrint Drive ;print drive letter
- PrintCR ' has been modified'
- PrintCR 'Press SPACE to do another,'
- Again:
- Print 'any other key exits: '
- KeyIn
- Cmp.B #' ',D0
- Beq Restart
- Term
-
-
- FilesExist:
- CR
- CR
- CR
- PrintCR '◆THIS IS NOT A BLANK DISK!'
- Exist2:
- PrintCR 'Press SPACE to retry,'
- Bra Again
-
- Oops:
- CR
- CR
- CR
- PrintCR '◆DISK WRITE ERROR! (check WP tab)'
- Bra Exist2
-
- Problems:
- CR
- CR
- CR
- PrintCR '◆This disk contains a value other'
- PrintCR 'than 1 or 2 as the sectors-per-'
- PrintCR 'cluster size...it may be a special'
- PrintCR 'format or a copy-protected game disk.'
- PrintCR 'If it is neither of these, then it'
- PrintCR 'might be a good idea to run a virus'
- PrintCR 'checking program on this disk to'
- PrintCR 'check for a possible viruses.'
- Bra Exist2
-
- Data
- AnyFiles: DC.B "?:\*.*",0
- Align
-
- BSS
- Drive: DS.W 1
- Sector0: DS.B 512 ;sector buffer
- Char: DS.W 1
-
- End
-