mirror of
https://github.com/Tolik-Trek/FORMAT.git
synced 2026-06-15 09:21:40 +03:00
138 lines
4.7 KiB
Z80 Assembly
138 lines
4.7 KiB
Z80 Assembly
;universal color print to console procedure like printf()
|
||
; in: IY
|
||
;
|
||
; <20>ਬ¥à ¤ ëå:
|
||
; DskInfo_Msg: DB "Formatted disk parameters:",cr,lf
|
||
; DB "Total sectors: ",tab,col_cmd,col_magenta, "%lu", col_cmd,col_white,cr,lf
|
||
; DB "Total size: ",tab,col_cmd,col_magenta, "%uMb", col_cmd,col_white,cr,lf
|
||
; DB "Units: ",tab,tab,col_cmd,col_magenta, "%u", col_cmd,col_white,cr,lf
|
||
; DB "Unit size: ",tab,col_cmd,col_magenta, "%u%c", col_cmd,col_white,cr,lf
|
||
; .FS: DB "File system: ",tab,col_cmd,col_magenta,"FAT16",col_cmd,col_white,cr,lf
|
||
; DB "Serial: ",tab,col_cmd,col_magenta, "%02x-%02x", col_cmd,col_white,cr,lf
|
||
; DB "Label: ",tab,tab,col_cmd,col_magenta, "NO LABEL",col_cmd,col_white,cr,lf,cr,lf,0
|
||
; .ptr: DW DskInfo_Msg
|
||
; .sectors: DS 4
|
||
; .mb: DW 0
|
||
; .units: DW 0
|
||
; .u_size: DW 0
|
||
; .u_sym: DB "K",0
|
||
; .serial: DS 4
|
||
;
|
||
; ¢ IY ¯®¬¥é ¥âáï DskInfo_Msg.ptr
|
||
;
|
||
; x, X hexadecimal
|
||
; D signed decimal
|
||
; U unsigned decimal
|
||
; L long
|
||
; C single character
|
||
; O octal
|
||
; S string
|
||
|
||
;-----------------------------------------------------------------------
|
||
Version_Msg: DB "DSS Drive Formatter v"
|
||
DB VERS_TXT, "."
|
||
DB MODF_TXT, "."
|
||
DB BUILD_TXT, ", "
|
||
DB "Copyright "
|
||
DB YEAR_TXT, " "
|
||
DZ "by Tolik_Trek@SprinterTeam\r\n\r\n"
|
||
.Size EQU $-Version_Msg
|
||
ASSERT Version_Msg.Size < 80+4, "ERROR: Version_Msg to long!"
|
||
;-----------------------------------------------------------------------
|
||
|
||
|
||
;-----------------------------------------------------------------------
|
||
Error_Msg: DZ "\r\n\r\nError!!!\r\n\r\n"
|
||
;-----------------------------------------------------------------------
|
||
|
||
|
||
;-----------------------------------------------------------------------
|
||
;!FIXIT Color settings
|
||
/*
|
||
col_magenta EQU 5
|
||
col_white EQU 7
|
||
col_cmd EQU 16
|
||
;
|
||
PARAMS_MSG: BYTE "\r\nDrive "
|
||
.disk BYTE "A: "
|
||
BYTE "will be formatted using the current settings:\r\n\r\n"
|
||
BYTE "Partition size:\t", col_cmd,col_magenta, "%S bytes", col_cmd,col_white, "\r\n"
|
||
BYTE "Available size:\t", col_cmd,col_magenta, "%S bytes", col_cmd,col_white, "\r\n"
|
||
BYTE "Unused space:\t", col_cmd,col_magenta, "%lu bytes", col_cmd,col_white, "\r\n"
|
||
BYTE "Clusters:\t", col_cmd,col_magenta, "%lu", col_cmd,col_white, "\r\n"
|
||
BYTE "Cluster size:\t", col_cmd,col_magenta, "%u bytes", col_cmd,col_white, "\r\n"
|
||
BYTE "File system:\t", col_cmd,col_magenta, "%S", col_cmd,col_white, "\r\n"
|
||
BYTE "Serial:\t\t", col_cmd,col_magenta, "%04x-%04x", col_cmd,col_white, "\r\n"
|
||
BYTE "Label:\t\t", col_cmd,col_magenta, "%S", col_cmd,col_white, "\r\n\r\n"
|
||
BYTE 'Press "Y" for format or any other key to exit', "\r\n"
|
||
BYTE 0
|
||
.ptr: WORD PARAMS_MSG
|
||
WORD .fullSize
|
||
WORD .dataSize
|
||
.unused: DWORD 0
|
||
.Clusters: DWORD 0
|
||
.Clu_size: WORD 0
|
||
WORD .FATtxt
|
||
.Serial: DWORD 0
|
||
WORD .LabelTxt
|
||
;
|
||
.FATtxt: DZ 'FAT '
|
||
.LabelTxt: DZ 'NO LABEL '
|
||
.fullSize: BYTE ' ',0
|
||
.dataSize: BYTE ' ',0
|
||
*/
|
||
;-----------------------------------------------------------------------
|
||
|
||
|
||
;-----------------------------------------------------------------------
|
||
PARAMS_MSG: BYTE "\r\nDrive "
|
||
.disk: BYTE "A: "
|
||
BYTE "will be formatted using the current settings:\r\n\r\n"
|
||
BYTE "Partition size:\t "
|
||
.fullSize: BYTE " bytes\r\n"
|
||
BYTE "Available size:\t "
|
||
.dataSize: BYTE " bytes\r\n"
|
||
BYTE "Unused space:\t "
|
||
.unused: BYTE " bytes\r\n"
|
||
BYTE "Clusters:\t "
|
||
.Clusters: BYTE " \r\n"
|
||
BYTE "Cluster size:\t "
|
||
.Clu_size: BYTE " bytes\r\n"
|
||
BYTE "File system:\t "
|
||
.FATtxt: BYTE "FAT \r\n"
|
||
BYTE "Serial:\t\t "
|
||
.Serial: BYTE "0000-0000\r\n"
|
||
BYTE "Label:\t\t ", '"'
|
||
.LabelTxt: BYTE 'NO LABEL "',"\r\n\r\n"
|
||
BYTE 'Press "Y" for format or any other key to exit', "\r\n"
|
||
BYTE 0
|
||
;-----------------------------------------------------------------------
|
||
|
||
|
||
;-----------------------------------------------------------------------
|
||
FORMATING_MSG: DZ "\rFormating drive. Please wait...\r\n"
|
||
;-----------------------------------------------------------------------
|
||
|
||
|
||
;-----------------------------------------------------------------------
|
||
DONE_MSG: DZ "Done!\r\n\r\n"
|
||
;-----------------------------------------------------------------------
|
||
|
||
|
||
;-----------------------------------------------------------------------
|
||
CANCELED_MSG: DZ "\r‘ancelled!\r\n\r\n"
|
||
;-----------------------------------------------------------------------
|
||
|
||
|
||
;-----------------------------------------------------------------------
|
||
HELP_MSG: BYTE "DDF it`s quck formating utility.\r\n"
|
||
BYTE "First parameter - drive letter.\r\n"
|
||
BYTE "Available keys:\r\n"
|
||
BYTE "/? - for this help,\r\n"
|
||
BYTE '/l "label" - for label.',"\r\n"
|
||
BYTE "Example:\r\n"
|
||
DZ 'format e: /l "dsk label"',"\r\n\r\n"
|
||
;-----------------------------------------------------------------------
|
||
|
||
|