This commit is contained in:
Tolik 2026-04-10 00:16:39 +10:00
parent 3d8f5ff222
commit 5bf7bd2b68
13 changed files with 510 additions and 61 deletions

41
Messages.z80 Normal file
View File

@ -0,0 +1,41 @@
;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!"
;-----------------------------------------------------------------------

64
Version.ini Normal file
View File

@ -0,0 +1,64 @@
IFNDEF INCREASE_BUILD
DEFINE INCREASE_BUILD 0
ELSE
DEFINE+ INCREASE_BUILD 1
ENDIF
;------------------[ „®áâ ñ¬ ⥪ãéãî ¤ âã ¨ BUILD++ ]-----------------[]
LUA PASS1
DDF_date, DDF_month, DDF_year = Get_date_RU(sj.get_define("__DATE__"))
if sj.get_define("INCREASE_BUILD") > "0" then
DDF_build = increase_build("ddf_build.txt")
else
DDF_build = get_build("ddf_build.txt")
end
if DDF_build > 999 then
DDF_build = 999
print("WARNING! Build > 999","WARNING! Build > 999","WARNING! Build > 999","WARNING! Build > 999","\aWARNING! Build > 999\a")
end
ENDLUA
LUA ALLPASS
DDF_Vers = sj.get_label("VERS")
DDF_Modf = sj.get_label("MODF")
sj.insert_label("lua_DAY", DDF_date)
sj.insert_label("lua_MONTH", DDF_month)
sj.insert_label("lua_YEAR", DDF_year)
sj.insert_label("lua_BUILD", DDF_build)
sj.insert_define("YEAR_TXT", "'" .. string.format("%04d", DDF_year) .. "'")
sj.insert_define("VERS_TXT", "'" .. string.format("%d", sj.get_label("VERS")) .. "'")
sj.insert_define("MODF_TXT", "'" .. string.format("%02d", sj.get_label("MODF")) .. "'")
sj.insert_define("BUILD_TXT", "'" .. string.format("%03d", DDF_build) .. "'")
ENDLUA
;---------------------------------------------------------------------[]
;
; DDF full version
; ­®¬¥à ¢¥àᨨ (0..9)
VERS EQU 0
; ­®¬¥à ¬®¤¨ä¨ª æ¨¨ (0..99)
MODF EQU 50
; ­®¬¥à ¡¨«¤  (0..999)
BUILD EQU lua_BUILD
;
; Release Types
RELEASE EQU 0
RC EQU 1
BETA EQU 2
DP EQU 3
;
; Build Type
OSTYPE EQU BETA
REVISION EQU 1
;
; Current date
DAY EQU lua_DAY
MONTH EQU lua_MONTH
YEAR EQU lua_YEAR
;

View File

@ -71,24 +71,44 @@ VARIABLES EQU $
;----------------------------------------------------------------------- ;-----------------------------------------------------------------------
; ‘â âãá ª«îç  : Š«îç : ‡­ ç¥­¨¥ MODULE KEYS_PARAMETERS
KEYS_PARAMETERS EQU $
.ONLY_HELP BYTE 0 : BYTE '?' : WORD 0 ; [ ] BYTE ; ¢ë¢®¤ á¯à ¢ª¨ STRUCT KEYS_STR
.FAT_TYPE BYTE 0 : BYTE 't' : WORD CONSTANTS.FAT12 ; [ ] BYTE ; .Status BYTE 0 ; ‘â âãá ª«îç 
.SectorsPerCluster: BYTE 0 : BYTE 'c' : WORD 0 ; [ ] BYTE ; .Key BYTE 0 ; Š«îç
.FilesInRootDIR: BYTE 0 : BYTE 'd' : WORD 0 ; [ ] WORD ; .Data WORD 0 ; „ ­­ë¥
.Number_of_FATs: BYTE 0 : BYTE 'n' : WORD 2 ; [ ] BYTE ; .Procedure WORD 0 ; ®¡à ¡®â稪
.RESERVED_SECTORS: BYTE 0 : BYTE 'r' : WORD 0 ; [ ] WORD ; ENDS
.LOW_FORMAT BYTE 0 : BYTE 'l' : WORD 0 ; [ ] BYTE ; ¤«ï ¤¨áª¥â
.BytesPerSector BYTE 0 : BYTE 's' : WORD #200 ; [ ] WORD ; MACRO KEY_DATA key?, proc?
; ᬥ饭¨ï ­  ¤ ­­ë¥ ; BYTE 0 ; ‘â âãá ª«îç 
.Status EQU 0 ; BYTE key? ; Š«îç
.Key EQU 1 ; WORD 0 ; „ ­­ë¥
.Data EQU 2 ; WORD proc? ; ®¡à ¡®â稪
KEYS_STR 0, key?, 0, proc?
ENDM
;-----------------------;
TABLE: EQU $
;
ONLY_HELP KEY_DATA '?', SHOW_HELP ; [ ] BYTE ; ¢ë¢®¤ á¯à ¢ª¨
LABEL KEY_DATA 'l', SET_LABEL ; [ ] WORD ; áá뫪  ­  ¯à®æ¥¤ãàã ¨­¨â  ¬¥âª¨
FAT_TYPE KEY_DATA 't', GET_KEY_FAT ; [ ] BYTE ;
SectorsPerCluster: KEY_DATA 'c', STRING_TO_WORD ; [ ] BYTE ;
FilesInRootDIR: KEY_DATA 'd', STRING_TO_WORD ; [ ] WORD ;
Number_of_FATs: KEY_DATA 'n', STRING_TO_WORD ; [ ] BYTE ;
RESERVED_SECTORS: KEY_DATA 'r', STRING_TO_WORD ; [ ] WORD ;
LOW_FORMAT KEY_DATA 'u', 0 ; [ ] BYTE ; ¤«ï ¤¨áª¥â
BytesPerSector KEY_DATA 's', STRING_TO_WORD ; [ ] WORD ;
;
TABLE.Size EQU $-TABLE
TABLE.Elements EQU TABLE.Size / KEYS_STR
;-----------------------;
;
; αβ βγα ; αβ βγα
.Status.Off EQU 0 Status.Off EQU 0
.Status.On EQU 0 Status.On EQU 1
.Status.Ignored EQU 0 Status.Ignored EQU 2
; ‘β βγα <20>«ξη : ; ‘β βγα <20>«ξη :
; 0 - ­¥ γαβ ­®Ά«¥­ ; 0 - ­¥ γαβ ­®Ά«¥­
; 1 - γαβ ­®Ά«¥­ ; 1 - γαβ ­®Ά«¥­
@ -100,6 +120,7 @@ FilesInRootDIR
BPB_BytsPerSec. «ο ¬ <EFBFBD>ᨬ «μ­®© α®Ά¬¥α⨬®αβ¨ ¤«ο ⮬®Ά FAT16 α«¥¤γ¥β BPB_BytsPerSec. «ο ¬ <EFBFBD>ᨬ «μ­®© α®Ά¬¥α⨬®αβ¨ ¤«ο ⮬®Ά FAT16 α«¥¤γ¥β
¨α®«μ§®Ά βμ §­ η¥­¨¥ 512. ¨α®«μ§®Ά βμ §­ η¥­¨¥ 512.
*/ */
ENDMODULE
;----------------------------------------------------------------------- ;-----------------------------------------------------------------------

1
ddf_build.txt Normal file
View File

@ -0,0 +1 @@
9

View File

@ -65,15 +65,64 @@ reserved_sectors = ( ((.HIDDEN + min_last_sector) & #0F)>0 ) * #10) - .HIDDEN
; ÚÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¿
; ³ DSS Drive Formatter for Sprinter ³
; ³ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ³
; ³ Tolik_Trek ³
; ³ 2026 ³
; ÀÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÙ
DEVICE ZXSPECTRUM4096 ; for debug
DEFINE INCREASE_BUILD
includelua 'Shared_includes/lua/Functions.lua'
INCLUDE 'shared_includes/constants/SP2000.inc'
INCLUDE 'shared_includes/constants/bios_equ.inc'
INCLUDE 'shared_includes/constants/dss_equ.inc'
INCLUDE 'shared_includes/structures/FileSystem.inc'
INCLUDE 'version.ini'
; Standart EQU section
;---------------------------------------------------------------------[]
org_addr EQU #8000 + CLP_Buffer
code_addr EQU DSS_DRIVE_FORMAT
stack_point EQU STACK_BUFFER
stack_buffer EQU 256
program_start EQU DSS_DRIVE_FORMAT
Loader_length EQU 0
;---------------------------------------------------------------------[]
; Code start section
;[]-------------------------------------------------------------------[]
DEFINE EXE_HEADER 1
INCLUDE 'Shared_Includes/constants/EXE_Header.z80'
ORG org_addr
;;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - []
; DSS Drive Formatter ; DSS Drive Formatter
//////////////////////////////////////////////////////////////////////// ;ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
;----------------------------------------------------------------------- ;-----------------------------------------------------------------------
DSS_DRIVE_FORMAT: DSS_DRIVE_FORMAT:
;----------------------------------------------------------------------- ;-----------------------------------------------------------------------
LD A,(KEYS_PARAMETERS.FAT_TYPE + KEYS_PARAMETERS.Status) LD (STOP_ERROR.Save_SP),SP
PUSH IX
POP HL
CALL PARSE_CMD
;
;!FIXIT
LD A,(KEYS_PARAMETERS.FAT_TYPE + KEYS_PARAMETERS.KEYS_STR.Status)
LD C,A LD C,A
; ¯à®¢¥àª  ­  § â㯠; ¯à®¢¥àª  ­  § âã¯
LD A,(KEYS_PARAMETERS.FilesInRootDIR + KEYS_PARAMETERS.Status) LD A,(KEYS_PARAMETERS.FilesInRootDIR + KEYS_PARAMETERS.KEYS_STR.Status)
AND A AND A
JR Z,.no_zatup JR Z,.no_zatup
; ;
@ -81,26 +130,20 @@ DSS_DRIVE_FORMAT:
OR A OR A
JR Z,.no_zatup JR Z,.no_zatup
; ;
LD A,(KEYS_PARAMETERS.FAT_TYPE + KEYS_PARAMETERS.Data) LD A,(KEYS_PARAMETERS.FAT_TYPE + KEYS_PARAMETERS.KEYS_STR.Data)
CP CONSTANTS.FAT32 CP CONSTANTS.FAT32
JR NZ,.no_zatup JR NZ,.no_zatup
; ;
LD A,KEYS_PARAMETERS.Status.Ignored LD A,KEYS_PARAMETERS.Status.Ignored
LD (KEYS_PARAMETERS.FilesInRootDIR + KEYS_PARAMETERS.Status),A LD (KEYS_PARAMETERS.FilesInRootDIR + KEYS_PARAMETERS.KEYS_STR.Status),A
.no_zatup: ; ¯à®¢¥àª  ­   ¢â®-à áçñâ .no_zatup: ; ¯à®¢¥àª  ­   ¢â®-à áçñâ
LD A,(KEYS_PARAMETERS.SectorsPerCluster + KEYS_PARAMETERS.Status) LD A,(KEYS_PARAMETERS.SectorsPerCluster + KEYS_PARAMETERS.KEYS_STR.Status)
OR C OR C
JR Z,MAKE_AUTO JR Z,MAKE_AUTO
; ;
; !TODO ; !TODO
; ;
MAKE_AUTO: LD (STOP_ERROR.Save_SP),SP MAKE_AUTO: CALL CALCULATE_FAT
;!FIXIT
LD A,(FMTDISK)
LD (VARIABLES.CurrentDrive),A
;
CALL CALCULATE_FAT
CALL FORMAT_DRIVE CALL FORMAT_DRIVE
CALL MAKE_LABEL_IN_DIR CALL MAKE_LABEL_IN_DIR
;!FIXIT ;!FIXIT
@ -155,7 +198,6 @@ CALCULATE_FAT: CALL .STEP1 ;
JR NZ,.BPB_BIG_TOTAL_SECTORS JR NZ,.BPB_BIG_TOTAL_SECTORS
; ;
LD (FAT_PARAMETERS.SectorsPerDrive),DE LD (FAT_PARAMETERS.SectorsPerDrive),DE
;!TODO ãáâ ­®¢¨âì ä« £, çâ® ¬¥«ª¨© ¤¨áª ­¥ ¤«ï FAT32 ¯à¨ €¢â®¬ â¥
JR .STEP1_2 JR .STEP1_2
; ;
.BPB_BIG_TOTAL_SECTORS: .BPB_BIG_TOTAL_SECTORS:
@ -358,7 +400,7 @@ CALC_TOTAL_CLUSTERS:
EX DE,HL EX DE,HL
POP HL POP HL
SBC HL,BC SBC HL,BC
JR C,STOP_ERROR JP C,STOP_ERROR
; data_sectors = HL:DE ; data_sectors = HL:DE
LD (VARIABLES.DataSectors_L),DE LD (VARIABLES.DataSectors_L),DE
LD (VARIABLES.DataSectors_H),HL LD (VARIABLES.DataSectors_H),HL
@ -453,34 +495,34 @@ SET_RESERVED_AND_ROOTDIR:
CALL .ChooseFilesInRootDIR CALL .ChooseFilesInRootDIR
RET RET
; ;
.for_fat32: LD A,(KEYS_PARAMETERS.FilesInRootDIR + KEYS_PARAMETERS.Status) .for_fat32: LD A,(KEYS_PARAMETERS.FilesInRootDIR + KEYS_PARAMETERS.KEYS_STR.Status)
DEC A DEC A
JR NZ,.set_for_fat32 JR NZ,.set_for_fat32
; ;
LD A,KEYS_PARAMETERS.Status.Ignored LD A,KEYS_PARAMETERS.Status.Ignored
LD (KEYS_PARAMETERS.FilesInRootDIR + KEYS_PARAMETERS.Status),A LD (KEYS_PARAMETERS.FilesInRootDIR + KEYS_PARAMETERS.KEYS_STR.Status),A
.set_for_fat32: LD HL,CONSTANTS.FAT_ReservedSectors.FAT32 .set_for_fat32: LD HL,CONSTANTS.FAT_ReservedSectors.FAT32
LD DE,CONSTANTS.FilesInRootDIR.HDD LD DE,CONSTANTS.FilesInRootDIR.HDD
JR .set_vars JR .set_vars
; ;
; ;
.ChooseFilesInRootDIR: .ChooseFilesInRootDIR:
LD A,(KEYS_PARAMETERS.FilesInRootDIR + KEYS_PARAMETERS.Status) LD A,(KEYS_PARAMETERS.FilesInRootDIR + KEYS_PARAMETERS.KEYS_STR.Status)
DEC A DEC A
JR NZ,.noChangeRootDir JR NZ,.noChangeRootDir
; ;
LD HL,(KEYS_PARAMETERS.FilesInRootDIR + KEYS_PARAMETERS.Data) LD HL,(KEYS_PARAMETERS.FilesInRootDIR + KEYS_PARAMETERS.KEYS_STR.Data)
.noChangeRootDir: .noChangeRootDir:
LD (FAT_PARAMETERS.FilesInRootDIR),HL LD (FAT_PARAMETERS.FilesInRootDIR),HL
RET RET
; ;
; ;
.ChooseReserved: .ChooseReserved:
LD A,(KEYS_PARAMETERS.RESERVED_SECTORS + KEYS_PARAMETERS.Status) LD A,(KEYS_PARAMETERS.RESERVED_SECTORS + KEYS_PARAMETERS.KEYS_STR.Status)
DEC A DEC A
JR NZ,.noChangeReserved JR NZ,.noChangeReserved
; ;
LD HL,(KEYS_PARAMETERS.RESERVED_SECTORS + KEYS_PARAMETERS.Data) LD HL,(KEYS_PARAMETERS.RESERVED_SECTORS + KEYS_PARAMETERS.KEYS_STR.Data)
.noChangeReserved: .noChangeReserved:
LD (FAT_PARAMETERS.RESERVED_SECTORS),HL LD (FAT_PARAMETERS.RESERVED_SECTORS),HL
RET RET
@ -865,6 +907,228 @@ MAKE_LABEL_IN_DIR:
;----------------------------------------------------------------------- ;-----------------------------------------------------------------------
;-----------------------------------------------------------------------
PARSE_CMD: LD A,(HL)
INC HL
AND A
JP Z,SHOW_VERSION
;
CALL .MAIN
JP C,STOP_ERROR
RET
;
.MAIN: PUSH HL
LD BC,Dss.EX_Path.GET_ALL
RST ToDSS
RET C
; ­ ¬ ­ã¦­  áâப  ¢ ª®â®à®© ¥áâì ¤à ©¢, ­® ­¥â ¯ãâ¨
AND %0000'1100
XOR %0000'1000
RET NZ
; ¤®áâ ñ¬ ¨¬ï ¤à ©¢  (®­® ¡¥§ ª«îç  "/")
POP HL
PUSH HL
LD DE,SECTOR_BUFFER
LD BC,Dss.EX_Path.GET_DRIVE
RST ToDSS
RET C
;
LD (VARIABLES.CurrentDrive),A
; ⮫쪮 ¤«ï ⮣®, ç⮡ ®¡­®¢¨âì ¯ à ¬¥âàë ¤à ©¢  (¢¤à㣠¤¨áª¥âã ᬥ­¨«¨?)
LD C,Dss.ChDisk
RST ToDSS
JR NC,.no_err_drv
;
CP DSS_Error.sys.MEDIA_CHANGED
JP NZ,STOP_ERROR
; ¯¥à¥¡¨à ¥¬ ª«îç¨ "/"
.no_err_drv: POP HL
.loop: LD A,(HL)
INC HL
AND A
RET Z
;
CP '/' ;
JR Z,.SET_KEY
;
CP ' '
JR Z,.loop
JP STOP_ERROR
;
;
.SET_KEY: LD A,(HL)
EX AF,AF'
INC HL
LD A,(HL)
INC HL
AND A
JR Z,.cont_set
;
CP ' '
JR Z,.cont_set
JP STOP_ERROR ; ­¥¯à ¢¨«ì­ë© ª«îç
;
.cont_set: EX AF,AF'
LD IX,KEYS_PARAMETERS.TABLE
LD B,KEYS_PARAMETERS.TABLE.Elements
LD DE,KEYS_PARAMETERS.KEYS_STR
;
.loop_key: CP (IX + KEYS_PARAMETERS.KEYS_STR.Key)
JR NZ,.next
;
EX DE,HL
LD L,(IX + KEYS_PARAMETERS.KEYS_STR.Procedure)
LD H,(IX + KEYS_PARAMETERS.KEYS_STR.Procedure + 1)
LD A,L
OR H
CALL NZ,JP_HL
EX DE,HL
LD A,KEYS_PARAMETERS.Status.On
JR NC,.set_stat
;
LD A,KEYS_PARAMETERS.Status.Ignored
.set_stat: LD (IX + KEYS_PARAMETERS.KEYS_STR.Status),A
JR .loop
;
.next: ADD IX,DE
DJNZ .loop_key
JP STOP_ERROR ; ­¥¯à ¢¨«ì­ë© ª«îç
;-----------------------------------------------------------------------
;-----------------------------------------------------------------------
JP_HL: JP (HL)
;-----------------------------------------------------------------------
;-----------------------------------------------------------------------
;!FIXIT
SHOW_VERSION: LD SP,(STOP_ERROR.Save_SP)
LD HL,Version_Msg
LD C,Dss.PChars
RST ToDSS
;
LD BC, 256*DSS_Error.sys.INVALID_DRIVE + Dss.Exit
RST ToDSS
;-----------------------------------------------------------------------
;-----------------------------------------------------------------------
;!FIXIT
SHOW_HELP: LD SP,(STOP_ERROR.Save_SP)
DI
HALT
;-----------------------------------------------------------------------
;-----------------------------------------------------------------------
;!FIXIT
GET_KEY_FAT: DI
HALT
;-----------------------------------------------------------------------
;-----------------------------------------------------------------------
;!FIXIT
SET_LABEL: DI
HALT
;-----------------------------------------------------------------------
;-----------------------------------------------------------------------
STRING_TO_WORD: CALL STR_TO_WORD
JP C,STOP_ERROR
;
LD (IX + KEYS_PARAMETERS.KEYS_STR.Data),L
LD (IX + KEYS_PARAMETERS.KEYS_STR.Data + 1),H
RET
;-----------------------------------------------------------------------
;-----------------------------------------------------------------------
; DEBUG_START: LD HL,.data
; CALL STRING_TO_WORD
; DI
; HALT
; ;
; .data: DZ "327670"
; IN: DE - (string decimal)
; OUT: HL - string to word
; DE - addr next after string decimal
;!FIXIT ¯à®¢¥àª  ­  ¯ãáâãî áâபã
STR_TO_WORD: LD HL,0
.loop: LD B,H
LD C,L
;
ADD HL,HL ;x2
RET C
ADD HL,HL ;x4
RET C
ADD HL,BC ;x5
RET C
ADD HL,HL ;x10
RET C
;
LD B,0
LD C,A
ADD HL,BC
RET C
;
LD A,(DE)
OR A
RET Z
CP ' '
RET Z
;
CP '9'+1
CCF
RET C
SUB '0'
RET C
;
INC DE
JR .loop
;-----------------------------------------------------------------------
;-----------------------------------------------------------------------
; Enin Anton
;<3B>à®æ¥¤ãà  ¯à¥®¡à §®¢ ­¨ï 8¡¨â®¢ëå ç¨á¥« ¢ è¥áâ­ ¤æ. ⥪áâ
;<3B>  ¢å®¤:
; HL -  ¤à¥á ¡ãä¥à 
; € - ¡ ©â
;<3B>  ¢ë室:
; ¡ãä¥à á ⥪áâ.ç¨á«®¬
IFUSED PutHexNumb
PutHexNumb
PUSH AF
RRCA
RRCA
RRCA
RRCA
AND #0F
ADD A,#90
DAA
ADC A,#40
DAA
LD (HL),A
INC L
POP AF
AND #0F
ADD A,#90
DAA
ADC A,#40
DAA
LD (HL),A
INC L
RET
ENDIF
;-----------------------------------------------------------------------
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
include 'math.asm' include 'math.asm'
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
@ -876,7 +1140,28 @@ MAKE_LABEL_IN_DIR:
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
SECTOR_BUFFER EQU $ include 'messages.z80'
.SIZE EQU 4096 ////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
;!FIXIT
include 'shared_includes/printf.asm'
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
STACK_BUFFER EQU $ + stack_buffer
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
SECTOR_BUFFER EQU STACK_BUFFER
.SIZE EQU 4096
ASSERT SECTOR_BUFFER + SECTOR_BUFFER.SIZE < #C000, "ERROR: SECTOR_BUFFER" ASSERT SECTOR_BUFFER + SECTOR_BUFFER.SIZE < #C000, "ERROR: SECTOR_BUFFER"
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
;ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
DISPLAY "PROGRAMM SIZE: ", /D, $ - DSS_DRIVE_FORMAT, " bytes"
;ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ

View File

@ -1,16 +1,3 @@
;ÚÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¿
;³ DSS Drive Formatter for Sprinter ³
;³ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ³
;³ Tolik_Trek ³
;³ 2026 ³
;ÀÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÙ
INCLUDE "shared_includes/constants/SP2000.inc"
INCLUDE "shared_includes/constants/bios_equ.inc"
INCLUDE "shared_includes/constants/dss_equ.inc"
INCLUDE "shared_includes/structures/FileSystem.inc"
;ÚÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¿ ;ÚÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¿
;³ FORMAT - Disk Format Utility for Sprinter ³ ;³ FORMAT - Disk Format Utility for Sprinter ³
;³ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ³ ;³ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ³
@ -69,8 +56,6 @@ main: DI
CALL prepare CALL prepare
JR NC,.ok_drive JR NC,.ok_drive
; ;
CALL DSS_DRIVE_FORMAT
;
LD A,"\a" ; bell LD A,"\a" ; bell
SYS ESTEX_pchar SYS ESTEX_pchar
LD DE,ProcessErr_Msg.ptr LD DE,ProcessErr_Msg.ptr
@ -439,12 +424,19 @@ testDskSize: ;EX AF,AF
; check max size for fat16 #3FFD00 sectors (512b) 4ÿ193ÿ152 + 512 + 1+16? ; PC - 7F600000 The FAT file system is limited to 65,525 clusters ; check max size for fat16 #3FFD00 sectors (512b) 4ÿ193ÿ152 + 512 + 1+16? ; PC - 7F600000 The FAT file system is limited to 65,525 clusters
/* /*
;!FIXIT ¯¥à¥áç¨â âì
Name Bytes Sectors
DATA 2ÿ147ÿ123ÿ200 max 4 193 600
FATx2 262 144 512
ROOT DIR 512..2ÿ097ÿ152 1..4096
RESERVED min 512 min 1
;
The FAT file system is limited to 65,525 clusters - 0x3FFD40 sectors The FAT file system is limited to 65,525 clusters - 0x3FFD40 sectors
FAT TABLES SIZE: 131ÿ072 x 2 = 262 144 = #200 FAT TABLES SIZE: 131ÿ072 x 2 = 262 144 = #200
ROOT DIR SIZE: 8 192 #10 ROOT DIR SIZE: 8 192 #10
RESERVED SECTORS SIZE: 5 x 512 = 2 560 5 RESERVED SECTORS SIZE: 5 x 512 = 2 560 5
HIDDEN SECTORS SIZE
*/ */
LD BC,#FD00 + 1 LD BC,#FD00 + 1
@ -801,11 +793,6 @@ badClust_Msg: DB cr,lf,"Bad cluster size.",cr,lf,cr,lf,0
buff EQU ( high $ + ((low $)<?1) ) * 256 buff EQU ( high $ + ((low $)<?1) ) * 256
////////////////////////////////////////////////////////////////////////
include 'new_format.asm'
////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
DISPLAY "programm size: ",$-EXEHeader DISPLAY "programm size: ",$-EXEHeader
Loader_End: Loader_End:

50
new_printf.asm Normal file
View File

@ -0,0 +1,50 @@
;;;;;;;;;;;;;;;;;
; A -  âਡãâë ¢ë¢®¤¨¬®£® ᨬ¢®«  ¥á«¨ CF'
; A' - ¥á«¨ !=0 â® ¡¥§ áªà®«« 
; CF - XY-mode
; DE - ¬¥á⮠ᨬ¢®«  ¢ ®ª­¥, ¥á«¨ CF=1
; HL -  ¤à¥á á ¢ë¢®¤¨¬®© áâப®©
; B - 梥⠪®­á®«¨ (¨á¯®«ì§ã¥âáï ¯à¨ áªà®««¥ ¨ ®ç¨á⪥ ®ª­ )
; IY - ¤¢  ᯥæ.ᨬ¢®«  ¤«ï ¢ë室  á CF=1. „®«¦­ë ¡ëâì à ¢­ë B, ¥á«¨ ­¥ ­ã¦­ë
; CF' - ¢ë¢®¤¨âì ᨬ¢®« á  âਡãâ ¬¨
;;;;;;;;;;;;;;;;;
;universal color print to console procedure like printf()
; in: HL
;
; <20>ਬ¥à ¤ ­­ëå:
; DskInfo_Msg: WORD .size - DskInfo_Msg
; DB "Formatted disk parameters:\r\n"
; DB "Total sectors: \t", "%K", "%lu", "%K\r\n"
; DB "Total size: \t", "%K", "%uMb", "%K\r\n"
; DB "Units: \t\t", "%K", "%u", "%K\r\n"
; DB "Unit size: \t", "%K", "%u%c", "%K\r\n"
; .FS: DB "File system: \t", "%K", "FAT16", "%K\r\n"
; DB "Serial: \t", "%K", "%02x-%02x", "%K\r\n"
; DB "Label: \t\t", "%K, "NO LABEL", "%K\r\n\r\n"
; DB 0
; .size: EQU $
; DB col_cmd,col_magenta
; .sectors: DS 4
; DB col_cmd,col_white
; .mb: DW 0
; DB col_cmd,col_magenta
; .units: DW 0
;
; .u_size: DW 0
; DB col_cmd,col_magenta
; .u_sym: DB "K",0
;
; .serial: DS 4
;
; ¢ Hl ¯®¬¥é ¥âáï DskInfo_Msg
;
; x, X hexadecimal
; D signed decimal
; U unsigned decimal
; L long
; C single character
; O octal
; S string
; K €ââਡãâë á«¥¤ãîé¨å ᨬ¢®«®¢