
; OnChangeAction:
; .setLang	EQU     1
; .nothing	EQU     2
; .setXYpos	EQU     3
; .setInt       EQU     4
; .setVsinc	EQU     5
; 	DEFINE SPTeam_year '2022'
; 	DEFINE Disk_subsystem_ver_txt '3.05'
; 	DEFINE SetupVer '2.55'
        LUA ALLPASS
	 function get_key_for_value(t, value)
		for column=1,2 do
  			for line,name in pairs(t[column]) do
    	 			if name==value then return column,line end
  			end
		end
  		return nil
	 end

	 function DeleteValueByDEFINE (t,zero_def,value)
	 	if tonumber(sj.get_define(zero_def)) then
			local delCol, delLine = get_key_for_value(t, value)
			table.remove (t[delCol], delLine)
		end
	 end
        ENDLUA

	LUA PASS1
		local date, month, year = Get_date_RU(sj.get_define("__DATE__"))
                BuildDate = "'" .. date .. "." .. month .. "." .. year .. "'"
		sj.insert_define("BUILD_DATE", BuildDate)
        ENDLUA
        LUA ALLPASS
                sj.insert_define("BUILD_DATE", BuildDate)
        ENDLUA
;
 LUA PASS1
	SettingsTabsOrder = {
		[1]={
			"Lang",		 -- 1
			"MemTest",	 -- 2
			"SaveRAMdrvs",	 -- 3
			"UpdBios",	 -- 4
			"StartDelay",	 -- 5
			"TypRate",	 -- 6
			"TypDelay",	 -- 7
			"RebootMsg",	 -- 8
			"SysDsk",	 -- 9
			"AltSysDsk",	 -- 10
			"FddFirst",	 -- 11
			"FddSecond",	 -- 12
			"PriIdeMA",	 -- 13
			"PriIdeSl",	 -- 14
			"SecIdeMA",	 -- 15
			"SecIdeSl",	 -- 16
					 -- 17
		},
		[2]={
			"ScreenY",	 -- 1
			"ScreenX",	 -- 2
			"FrameInt",	 -- 3
			"VSync",	 -- 4
			"QuickStartROM", -- 5
			"TrDosA",	 -- 6
			"TrDosB",	 -- 7
			"TrDosC",	 -- 8
			"TrDosD",	 -- 9
                        "SetTime",	 -- 10	DEFINES.INC --> NEW_FEATURE
			"HddWrPr",	 -- 11	DEFINES.INC --> HDDwriteProtect
					 -- 12
					 -- 13
					 -- 14
					 -- 15
					 -- 16
					 -- 17
		}
	}
	DeleteValueByDEFINE(SettingsTabsOrder,"NEW_FEATURE","SetTime")
	DeleteValueByDEFINE(SettingsTabsOrder,"HDDwriteProtect","HddWrPr")
 ENDLUA
;

;
 MACRO _mSETitemParams itemName?
@.itemName?	EQU $
  DEFINE TmpDef itemName?
	LUA ALLPASS
	local tmpName = sj.get_define("TmpDef")
	local column,line = get_key_for_value(SettingsTabsOrder, tmpName)
	if (column == nil or line == nil) then sj.error("Settings Tab not found",tmpName) end
	if column == 1 then column = _c("firstColumn") else column = _c("secondColumn") end
	sj.insert_define("columnNum", column)
	sj.insert_define("lineNum", (_c("firstLine")+line-1))
	sj.insert_define("paramName", "msgStrings.par" .. tmpName)
	ENDLUA
  UNDEFINE TmpDef
 ENDM
;

 MACRO _mCreateSettingsItemsTabsAddrs
  LUA ALLPASS
	for i = 1, #SettingsTabsOrder do
		for j = 1, #SettingsTabsOrder[i] do
			_pc("DW	" .. _c("SettingsItemsTabs." .. SettingsTabsOrder[i][j]))
		end
	end
  ENDLUA

; создаёт такую структуру:	
; DW	SettingsItemsTabs.FirstItem
; DW	..
; DW	SettingsItemsTabs.LastItem
 ENDM

 MACRO _mCreateMsgAddrTable		; !FIXIT доделать на приём параметра "msgRusStrings.msg_", а лучше внутри самому определять эту метку
  LUA ALLPASS
	for i = 0, _c("tmp_Counter")-1, 1 do
		_pc("WORD " .. "msgRusStrings.msg_" .. i)
	end
  ENDLUA

; создаёт такую структуру:	
;	WORD	msgRusStrings.msg_0
;	..
;	WORD	msgRusStrings.msg_XX	; XX = tmp_Counter
 ENDM

;----------------------------[Settings items table]----------------------------[v]

;
 IF NEW_FEATURE
; New structure for procedure with IY reg
        STRUCT MenusItem
Action          WORD
Type            BYTE
Column          BYTE
Line            BYTE
Name            BYTE
CMOSreg         BYTE
ValueMask       BYTE
ValueMax        BYTE
FirstString     BYTE
        ENDS

paramLine       EQU     0
folderLine      EQU     1

 ENDIF
;

firstColumn     EQU     03                                              ; смещение по X для первого столбца
secondColumn    EQU     43                                              ; смещение по X для второго столбца
firstLine       EQU     07                                              ; смещение по Y для первой строки

SettingsItemsTabs:

	_mSETitemParams Lang
	DW	OnChangeAction.setLang                                  ; действие при изменении
        IF NEW_FEATURE :     DB      paramLine : ENDIF                                               ; тип параметра (строка со значением или каталог)
	DB	columnNum,lineNum                                       ; столбец, строка
	DB	paramName                                               ; Название параметра
	DB	#0E,%0000'0100,%0000'0100                                 ; CMOS, MASK
	DB	msgStrings.valLangEng                                   ; 1-й вариант параметра 
	DB	msgStrings.valLangRus                                   ; 2-й вариант параметра 

	_mSETitemParams MemTest
	DW	OnChangeAction.nothing
        IF NEW_FEATURE :     DB      paramLine : ENDIF
	DB	columnNum,lineNum
	DB	paramName
	DB	#0E,%1000'0000,%1000'0000
	DB	msgStrings.valDisabled
	DB	msgStrings.valEnabled

	_mSETitemParams SaveRAMdrvs
	DW	OnChangeAction.nothing
        IF NEW_FEATURE :     DB      paramLine : ENDIF
	DB	columnNum,lineNum
	DB	paramName
	DB	#0E,%0100'0000,%0100'0000
	DB	msgStrings.valDisabled
	DB	msgStrings.valEnabled

	_mSETitemParams UpdBios
	DW	OnChangeAction.nothing
        IF NEW_FEATURE :     DB      paramLine : ENDIF
	DB	columnNum,lineNum
	DB	paramName
	DB	#0E,%0010'0000,%0010'0000
	DB	msgStrings.valDisabled
	DB	msgStrings.valEnabled

	_mSETitemParams StartDelay
	DW	OnChangeAction.nothing
        IF NEW_FEATURE :     DB      paramLine : ENDIF
	DB	columnNum,lineNum
	DB	paramName
	DB	#0E,%0001'1000,%0001'0000
	DB	msgStrings.valDisabled
	DB	msgStrings.valNormal
	DB	msgStrings.valEnabled

	_mSETitemParams TypRate
	DW	OnChangeAction.nothing
        IF NEW_FEATURE :     DB      paramLine : ENDIF
	DB	columnNum,lineNum
	DB	paramName
	DB	#0F,%0000'0111,%0000'0111
	DB	msgStrings.val_6
	DB	msgStrings.val_8
	DB	msgStrings.val_10
	DB	msgStrings.val_12
	DB	msgStrings.val_15
	DB	msgStrings.val_20
	DB	msgStrings.val_24
	DB	msgStrings.val_30

	_mSETitemParams TypDelay
	DW	OnChangeAction.nothing
        IF NEW_FEATURE :     DB      paramLine : ENDIF
	DB	columnNum,lineNum
	DB	paramName
	DB	#0F,%0110'0000,%0110'0000
	DB	msgStrings.val_250
	DB	msgStrings.val_500
	DB	msgStrings.val_750
	DB	msgStrings.val_1000

	_mSETitemParams RebootMsg
	DW	OnChangeAction.nothing
        IF NEW_FEATURE :     DB      paramLine : ENDIF
	DB	columnNum,lineNum
	DB	paramName
	DB	#1D,%0000'0010,%0000'0010
	DB	msgStrings.valDisabled
	DB	msgStrings.valEnabled

	_mSETitemParams SysDsk
	DW	OnChangeAction.nothing
        IF NEW_FEATURE :     DB      paramLine : ENDIF
	DB	columnNum,lineNum
	DB	paramName
	DB	#10,%0000'0111,%0000'0111											; !!!!!
	DB	msgStrings.val1stFDD
	DB	msgStrings.val2ndFDD
	DB	msgStrings.val1stIDE
	DB	msgStrings.val2ndIDE
	DB	msgStrings.val3rdIDE
	DB	msgStrings.val4thIDE
	DB	msgStrings.valRamDsk
        DB	msgStrings.valRecovery

	_mSETitemParams AltSysDsk
	DW	OnChangeAction.nothing
        IF NEW_FEATURE :     DB      paramLine : ENDIF
	DB	columnNum,lineNum
	DB	paramName
	DB	#10,%0111'0000,%0111'0000
	DB	msgStrings.val1stFDD
	DB	msgStrings.val2ndFDD
	DB	msgStrings.val1stIDE
	DB	msgStrings.val2ndIDE
	DB	msgStrings.val3rdIDE
	DB	msgStrings.val4thIDE
	DB	msgStrings.valRamDsk
        DB	msgStrings.valRecovery

	_mSETitemParams FddFirst
	DW	OnChangeAction.nothing
        IF NEW_FEATURE :     DB      paramLine : ENDIF
	DB	columnNum,lineNum
	DB	paramName
	DB	#11,%0000'0011,%0000'0000
	DB	msgStrings.valAuto
;	DB	msgStrings.val720
;	DB	msgStrings.val1440
;	DB	msgStrings.valDash6

	_mSETitemParams FddSecond
	DW	OnChangeAction.nothing
        IF NEW_FEATURE :     DB      paramLine : ENDIF
	DB	columnNum,lineNum
	DB	paramName
	DB	#11,%0000'1100,%0000'0000
	DB	msgStrings.valAuto
;	DB	msgStrings.val720
;	DB	msgStrings.val1440
;	DB	msgStrings.valDash6

	_mSETitemParams PriIdeMA
	DW	OnChangeAction.nothing
        IF NEW_FEATURE :     DB      paramLine : ENDIF
	DB	columnNum,lineNum
	DB	paramName
	DB	#11,%0011'0000,%0011'0000
	DB	msgStrings.valAuto
	DB	msgStrings.valSetup
	DB	msgStrings.valCdRom
	DB	msgStrings.valDash6

	_mSETitemParams PriIdeSl
	DW	OnChangeAction.nothing
        IF NEW_FEATURE :     DB      paramLine : ENDIF
	DB	columnNum,lineNum
	DB	paramName
	DB	#11,%1100'0000,%1100'0000
	DB	msgStrings.valAuto
	DB	msgStrings.valSetup
	DB	msgStrings.valCdRom
	DB	msgStrings.valDash6

	_mSETitemParams SecIdeMA
	DW	OnChangeAction.nothing
        IF NEW_FEATURE :     DB      paramLine : ENDIF
	DB	columnNum,lineNum
	DB	paramName
	DB	#20,%0011'0000,%0011'0000
	DB	msgStrings.valAuto
	DB	msgStrings.valSetup
	DB	msgStrings.valCdRom
	DB	msgStrings.valDash6

	_mSETitemParams SecIdeSl
	DW	OnChangeAction.nothing
        IF NEW_FEATURE :     DB      paramLine : ENDIF
	DB	columnNum,lineNum
	DB	paramName
	DB	#20,%1100'0000,%1100'0000
	DB	msgStrings.valAuto
	DB	msgStrings.valSetup
	DB	msgStrings.valCdRom
	DB	msgStrings.valDash6

	IF	HDDwriteProtect
	 _mSETitemParams HddWrPr
	 DW	OnChangeAction.nothing
         IF NEW_FEATURE :     DB      paramLine : ENDIF
	 DB	columnNum,lineNum
	 DB	paramName
	 DB	#1D,%0000'0001,%0000'0001
	 DB	msgStrings.valDisabled
	 DB	msgStrings.valEnabled
	ENDIF

	_mSETitemParams ScreenY
	DW	OnChangeAction.setXYpos
        IF NEW_FEATURE :     DB      paramLine : ENDIF
	DB	columnNum,lineNum
	DB	paramName
	DB	#1F,%1111'0000,%1110'0000
	DB	msgStrings.valMinus7
	DB	msgStrings.valMinus6
	DB	msgStrings.valMinus5
	DB	msgStrings.valMinus4
	DB	msgStrings.valMinus3
	DB	msgStrings.valMinus2
	DB	msgStrings.valMinus1
	DB	msgStrings.val_0
	DB	msgStrings.valPlus1
	DB	msgStrings.valPlus2
	DB	msgStrings.valPlus3
	DB	msgStrings.valPlus4
	DB	msgStrings.valPlus5
	DB	msgStrings.valPlus6
	DB	msgStrings.valPlus7

	_mSETitemParams ScreenX
	DW	OnChangeAction.setXYpos
        IF NEW_FEATURE :     DB      paramLine : ENDIF
	DB	columnNum,lineNum
	DB	paramName
	DB	#1F,%0000'1111,%0000'1110
	DB	msgStrings.valPlus7
	DB	msgStrings.valPlus6
	DB	msgStrings.valPlus5
	DB	msgStrings.valPlus4
	DB	msgStrings.valPlus3
	DB	msgStrings.valPlus2
	DB	msgStrings.valPlus1
	DB	msgStrings.val_0
	DB	msgStrings.valMinus1
	DB	msgStrings.valMinus2
	DB	msgStrings.valMinus3
	DB	msgStrings.valMinus4
	DB	msgStrings.valMinus5
	DB	msgStrings.valMinus6
	DB	msgStrings.valMinus7

	_mSETitemParams FrameInt
	DW	OnChangeAction.setInt
        IF NEW_FEATURE :     DB      paramLine : ENDIF
	DB	columnNum,lineNum
	DB	paramName
	DB	#1A,%0011'0000,%0011'0000
	DB	msgStrings.valDash8
	DB	msgStrings.valScorpion
	DB	msgStrings.valPentagon
	DB	msgStrings.valSpectrum

	_mSETitemParams VSync
	DW	OnChangeAction.setVsinc
        IF NEW_FEATURE :     DB      paramLine : ENDIF
	DB	columnNum,lineNum
	DB	paramName
	DB	#1A,%1100'0000,%1000'0000
	DB	msgStrings.valDash8
	DB	msgStrings.val312_50
	DB	msgStrings.val320_49

	_mSETitemParams QuickStartROM
	DW	OnChangeAction.nothing
        IF NEW_FEATURE :     DB      paramLine : ENDIF
	DB	columnNum,lineNum
	DB	paramName
	DB	#0E,%0000'0001,%0000'0001
	DB	msgStrings.valDisabled
	DB	msgStrings.valEnabled

	_mSETitemParams TrDosA
	DW	OnChangeAction.nothing
        IF NEW_FEATURE :     DB      paramLine : ENDIF
	DB	columnNum,lineNum
	DB	paramName
	DB	#1E,%0000'0011,%0000'0010
	DB	msgStrings.valDefault
	DB	msgStrings.valFDD
	DB	msgStrings.valHDD

	_mSETitemParams TrDosB
	DW	OnChangeAction.nothing
        IF NEW_FEATURE :     DB      paramLine : ENDIF
	DB	columnNum,lineNum
	DB	paramName
	DB	#1E,%0000'1100,%0000'1000
	DB	msgStrings.valDefault
	DB	msgStrings.valFDD
	DB	msgStrings.valHDD

	_mSETitemParams TrDosC
	DW	OnChangeAction.nothing
        IF NEW_FEATURE :     DB      paramLine : ENDIF
	DB	columnNum,lineNum
	DB	paramName
	DB	#1E,%0011'0000,%0010'0000
	DB	msgStrings.valDefault
	DB	msgStrings.valFDD
	DB	msgStrings.valHDD

	_mSETitemParams TrDosD
	DW	OnChangeAction.nothing
        IF NEW_FEATURE :     DB      paramLine : ENDIF
	DB	columnNum,lineNum
	DB	paramName
	DB	#1E,%1100'0000,%1000'0000
	DB	msgStrings.valDefault
	DB	msgStrings.valFDD
	DB	msgStrings.valHDD

 IF NEW_FEATURE
        _mSETitemParams SetTime
	DW	OnChangeAction.SetTime
        DB      folderLine
	DB	columnNum,lineNum
	DB	paramName
	DB	#00,%0000'0000,%0000'0000
	DB	msgStrings.valFolder
 ENDIF
;--------------------[Items Addresses table]--------------------[]	
SettingsItemsTabsAddrs:
	_mCreateSettingsItemsTabsAddrs
.max	EQU	($-SettingsItemsTabsAddrs)/2

	; db	on-change routine addr
	; db	X,Y
	; db	string-name number
	; db	CMOS, MASK
	; db	string-value number 1, .. , string-value number XX
;----------------------------------------------------------------[]	

;----------------------------[Settings items table]----------------------------[^]

;
;	!TODO	добавить экспорт создаваемых переменных в отдельный файл для справки
 MACRO _mSetStr Suffix?, Num?
@.Suffix?	EQU Num?
	LUA ALLPASS
		_pl("@.msg_" .. _c("Num?"))
	ENDLUA
!tmp_Counter = tmp_Counter + 1
 ENDM
;
;

;
;	!TODO	добавить экспорт создаваемых переменных в отдельный файл для справки
 MACRO _mSetStrRus Suffix?, Num?
	DEFINE TmpDef Suffix?
	LUA ALLPASS
		if (_c("msgStrings." .. sj.get_define("TmpDef"))) ~= _c("Num?") then
			sj.error("Sequence matching between Russian and English strings is broken!!!")
		else
			_pl("@.msg_" .. _c("Num?"))
		end
	ENDLUA
	UNDEFINE TmpDef
!tmp_Counter = tmp_Counter + 1
 ENDM
;
;
;
;==================================================================================================================================
; Не менять бездумно название метки msgStrings !!! Участвует в LUA макросе в этом же файле.
tmp_Counter DEFL 0
msgStrings:
 _mSetStr copyRightPeters, tmp_Counter		:	DZ	'Copyright (c) 2002 Peters Plus'
 _mSetStr copyRightSPTeam, tmp_Counter		:	DZ	'Copyright (c) 2009-', SPTeam_year, ' Sprinter Team'
 _mSetStr setupBiosVer, tmp_Counter		:	DZ	'Sprinter BIOS v', Disk_subsystem_ver_txt
 _mSetStr setupCopyRight, tmp_Counter		:	DZ	'Copyright (c) 2002 Peters Plus, (c) 2009-', SPTeam_year, ' Sprinter Team'
 _mSetStr setupUtilityVer, tmp_Counter		:	DZ	'SETUP Utility v', SetupVer
 _mSetStr setupHelpStr1, tmp_Counter		:	DZ	'ESC : Quit                               F10 : Save & Exit Setup'
 _mSetStr setupHelpStr2, tmp_Counter		:	DZ	'F2  : Save Values                    ',24,32,25,32,26,32,27,' : Select Item' ; коды стрелок вместе с пробелами: 24,32,25,32,26,32,27
 _mSetStr setupHelpStr3, tmp_Counter		:	DZ	'F5  : Old Values                   PU/PD/+/- : Modify'
 _mSetStr setupHelpStr4, tmp_Counter		:	DZ	'F7  : Default Values                      F3 : Color '
 _mSetStr toSetupButton, tmp_Counter		:	DZ	'<DEL> to enter SETUP'
 _mSetStr forAltBootButton, tmp_Counter		:	DZ	'<ALT> for Alternative boot'
 _mSetStr cmosChecksumErr, tmp_Counter		:	DZ	'WARNING! CMOS CHECKSUM ERROR, DEFAULT VALUES SET!'
 _mSetStr cmosDateTimeErr, tmp_Counter		:	DZ	'WARNING! CMOS DATE/TIME ERROR, DEFAULT VALUES SET!'
 _mSetStr detectIdePrMA, tmp_Counter		:	DZ	' Detecting IDE Primary Master   ... [Press F4 to skip]'
 _mSetStr detectIdePrSL, tmp_Counter		:	DZ	' Detecting IDE Primary Slave    ... [Press F4 to skip]'
 _mSetStr detectIdeSecMA, tmp_Counter		:	DZ	' Detecting IDE Secondary Master ... [Press F4 to skip]'
 _mSetStr detectIdeSecSL, tmp_Counter		:	DZ	' Detecting IDE Secondary Slave  ... [Press F4 to skip]'
 _mSetStr ideUnknown, tmp_Counter		:	DZ	'Unknown           '
 _mSetStr ideNone, tmp_Counter			:	DZ	'None              '
 _mSetStr ideSkiped, tmp_Counter		:	DZ	'Skipped           '
 _mSetStr ideFail, tmp_Counter			:	DZ	'Fail              '	; !FIXIT strFail
 _mSetStr spModel, tmp_Counter			:	DZ	'Model name: '
 _mSetStr spMemory, tmp_Counter			:	DZ	'Memory    : '
 _mSetStr cmosFound, tmp_Counter		:	DZ	'CMOS      : Found'
 _mSetStr cmosNone, tmp_Counter			:	DZ	'CMOS      : None'
 _mSetStr memoryAvailable, tmp_Counter		:	DZ	'Available : '
; _mSetStr unknownSTR1, tmp_Counter		:	DZ	"7"
; _mSetStr unknownSTR2, tmp_Counter		:	DZ	"8"
 _mSetStr boardID, tmp_Counter			:	DZ	'Board ID  : '
 _mSetStr bootFdd, tmp_Counter			:	DZ	'Boot from Diskette... '
; _mSetStr bootHdd, tmp_Counter			:	DZ	'Boot from Hard disk... '
 _mSetStr bootHdd, tmp_Counter			:	DZ	'Boot from HDD at '
 _mSetStr bootCd, tmp_Counter			:	DZ	'Boot from CD-ROM at '
 _mSetStr bootRamDrv, tmp_Counter		:	DZ	'Boot from RAM disk... '
 _mSetStr bootRecovery, tmp_Counter		:	DZ	'Starting recovery...'
 _mSetStr bootAltDrv, tmp_Counter		:	DZ	'Alternative '
 _mSetStr bootFail, tmp_Counter			:	DZ	'fail'					; !FIXIT strFail
 _mSetStr bootOk, tmp_Counter			:	DZ	'OK'
 _mSetStr afterBootFail, tmp_Counter		:	DZ	'PRESS <ENTER> TO REBOOT, <DEL> TO ENTER SETUP OR <ESC> TO ZX-MODE . . .'
;
 _mSetStr parLang, tmp_Counter			:	DZ	'Language (Язык)            : '
 _mSetStr valLangEng, tmp_Counter		:	DZ	'English '
 _mSetStr valLangRus, tmp_Counter		:	DZ	'Русский '
 _mSetStr parMemTest, tmp_Counter		:	DZ	'Memory Test                : '
 _mSetStr valDisabled, tmp_Counter		:	DZ	'Disabled'
 _mSetStr valEnabled, tmp_Counter		:	DZ	'Enabled '
 _mSetStr parSaveRAMdrvs, tmp_Counter		:	DZ	'Save RAM-disks             : '
 _mSetStr parUpdBios, tmp_Counter		:	DZ	'Update BIOS                : '
 _mSetStr parStartDelay, tmp_Counter		:	DZ	'Start Delay                : '
 _mSetStr valNormal, tmp_Counter		:	DZ	'Normal  '
 _mSetStr parTypRate, tmp_Counter		:	DZ	'Typematic Rate (Chars/Sec) : '
 _mSetStr val_6, tmp_Counter			:	DZ	'6 '
 _mSetStr val_8, tmp_Counter			:	DZ	'8 '
 _mSetStr val_10, tmp_Counter			:	DZ	'10'
 _mSetStr val_12, tmp_Counter			:	DZ	'12'
 _mSetStr val_15, tmp_Counter			:	DZ	'15'
 _mSetStr val_20, tmp_Counter			:	DZ	'20'
 _mSetStr val_24, tmp_Counter			:	DZ	'24'
 _mSetStr val_30, tmp_Counter			:	DZ	'30'
 _mSetStr parTypDelay, tmp_Counter		:	DZ	'Typematic Delay (Msec)     : '
 _mSetStr val_250, tmp_Counter			:	DZ	'250 '
 _mSetStr val_500, tmp_Counter			:	DZ	'500 '
 _mSetStr val_750, tmp_Counter			:	DZ	'750 '
 _mSetStr val_1000, tmp_Counter			:	DZ	'1000'
 _mSetStr parRebootMsg, tmp_Counter		:	DZ	'Reboot message             : '
 _mSetStr parSysDsk, tmp_Counter		:	DZ	'System Disk                : '
 _mSetStr val1stFDD, tmp_Counter		:	DZ	'1-st FDD'
 _mSetStr val2ndFDD, tmp_Counter		:	DZ	'2-nd FDD'
 _mSetStr val1stIDE, tmp_Counter		:	DZ	'1-st IDE'
 _mSetStr val2ndIDE, tmp_Counter		:	DZ	'2-nd IDE'
 _mSetStr val3rdIDE, tmp_Counter		:	DZ	'3-rd IDE'
 _mSetStr val4thIDE, tmp_Counter		:	DZ	'4-th IDE'
 _mSetStr valRamDsk, tmp_Counter		:	DZ	'RAM-DISK'
 _mSetStr valRecovery, tmp_Counter		:	DZ	'RECOVERY'
 _mSetStr parAltSysDsk, tmp_Counter		:	DZ	'Alt. System Disk           : '
 _mSetStr parFddFirst, tmp_Counter		:	DZ	'FDD First                  : '
 _mSetStr valAuto, tmp_Counter			:	DZ	'Auto  '
; _mSetStr val720, tmp_Counter			:	DZ	'720K  '
; _mSetStr val1440, tmp_Counter			:	DZ	'1.44M '
 _mSetStr valDash6, tmp_Counter			:	DZ	'------'
 _mSetStr parFddSecond, tmp_Counter		:	DZ	'FDD Second                 : '
 _mSetStr parPriIdeMA, tmp_Counter		:	DZ	'Primary IDE Master         : '
 _mSetStr valSetup, tmp_Counter			:	DZ	'Setup '
 _mSetStr valCdRom, tmp_Counter			:	DZ	'CD-ROM'
 _mSetStr parPriIdeSl, tmp_Counter		:	DZ	'Primary IDE Slave          : '
 _mSetStr parSecIdeMA, tmp_Counter		:	DZ	'Secondary IDE Master       : '
 _mSetStr parSecIdeSl, tmp_Counter		:	DZ	'Secondary IDE Slave        : '
 IF HDDwriteProtect
  _mSetStr parHddWrPr, tmp_Counter		:	DZ	'HDD Write protect          : '
 ENDIF
 _mSetStr parScreenY, tmp_Counter		:	DZ	'Y-Screen position   : '
 _mSetStr valMinus7, tmp_Counter		:	DZ	'-7'
 _mSetStr valMinus6, tmp_Counter		:	DZ	'-6'
 _mSetStr valMinus5, tmp_Counter		:	DZ	'-5'
 _mSetStr valMinus4, tmp_Counter		:	DZ	'-4'
 _mSetStr valMinus3, tmp_Counter		:	DZ	'-3'
 _mSetStr valMinus2, tmp_Counter		:	DZ	'-2'
 _mSetStr valMinus1, tmp_Counter		:	DZ	'-1'
 _mSetStr val_0, tmp_Counter			:	DZ	' 0'
 _mSetStr valPlus1, tmp_Counter			:	DZ	'+1'
 _mSetStr valPlus2, tmp_Counter			:	DZ	'+2'
 _mSetStr valPlus3, tmp_Counter			:	DZ	'+3'
 _mSetStr valPlus4, tmp_Counter			:	DZ	'+4'
 _mSetStr valPlus5, tmp_Counter			:	DZ	'+5'
 _mSetStr valPlus6, tmp_Counter			:	DZ	'+6'
 _mSetStr valPlus7, tmp_Counter			:	DZ	'+7'
 _mSetStr parScreenX, tmp_Counter		:	DZ	'X-Screen position   : '
 _mSetStr parFrameInt, tmp_Counter		:	DZ	'Frame interrupt     : '
 _mSetStr valDash8, tmp_Counter			:	DZ	'--------'
 _mSetStr valScorpion, tmp_Counter		:	DZ	'Scorpion'
 _mSetStr valPentagon, tmp_Counter		:	DZ	'Pentagon'
 _mSetStr valSpectrum, tmp_Counter		:	DZ	'Spectrum'
 _mSetStr parVSync, tmp_Counter			:	DZ	'V-synchronization   : '
 _mSetStr val312_50, tmp_Counter		:	DZ	'312/50Hz'
 _mSetStr val320_49, tmp_Counter		:	DZ	'320/49Hz'
 _mSetStr parQuickStartROM, tmp_Counter		:	DZ	'Quick ROM Start     : '
 _mSetStr parTrDosA, tmp_Counter		:	DZ	'TR DOS A:>          : '
 _mSetStr valDefault, tmp_Counter		:	DZ	'Default'
 _mSetStr valFDD, tmp_Counter			:	DZ	'FDD    '				; ????? подумать какие варианты возможны
 _mSetStr valHDD, tmp_Counter			:	DZ	'HDD    '				; ????? подумать какие варианты возможны
 _mSetStr parTrDosB, tmp_Counter		:	DZ	'TR DOS B:>          : '
 _mSetStr parTrDosC, tmp_Counter		:	DZ	'TR DOS C:>          : '
 _mSetStr parTrDosD, tmp_Counter		:	DZ	'TR DOS D:>          : '
 IF NEW_FEATURE
  _mSetStr parSetTime, tmp_Counter		:       DZ      'Date and Time setup : '
  _mSetStr valFolder, tmp_Counter		:       DB      16,'ENTER',17,0
 ENDIF
 IF DEBUG
  _mSetStr testBIOSmsg, tmp_Counter		:	DZ      'Test build! ',BUILD_DATE,', ',__TIME__
 ENDIF
;

MSG_ENG:	; !FIXIT подставить макрос _mCreateMsgAddrTable который надо доделать на приём параметра "msgStrings.msg_" или "msgRusStrings.msg_"
	LUA ALLPASS
		for i = 0, _c("tmp_Counter")-1, 1 do
			_pc("WORD " .. "msgStrings.msg_" .. i)
		end
	ENDLUA
/*
	WORD	msgStrings.msg_0
	..
	WORD	msgStrings.msg_XX	; XX = tmp_Counter
*/
MSG_ENG.size     EQU $-MSG_ENG
;==================================================================================================================================

;==================================================================================================================================
tmp_Counter = 0
msgRusStrings:
 _mSetStrRus copyRightPeters, tmp_Counter       :       DZ      'Copyright (c) 2002 Peters Plus'
 _mSetStrRus copyRightSPTeam, tmp_Counter       :       DZ      'Copyright (c) 2009-', SPTeam_year, ' Sprinter Team'
 _mSetStrRus setupBiosVer, tmp_Counter	        :       DZ      'Sprinter BIOS v', Disk_subsystem_ver_txt
 _mSetStrRus setupCopyRight, tmp_Counter        :       DZ      'Copyright (c) 2002 Peters Plus, (c) 2009-', SPTeam_year, ' Sprinter Team'
 _mSetStrRus setupUtilityVer, tmp_Counter       :       DZ      'SETUP Utility v', SetupVer
 _mSetStrRus setupHelpStr1, tmp_Counter	        :       DZ      'ESC : Выйти                              F10 : Сохранить и выйти'
 _mSetStrRus setupHelpStr2, tmp_Counter	        :       DZ      'F2  : Сохранить значения             ',24,32,25,32,26,32,27,' : Выбор пункта'
 _mSetStrRus setupHelpStr3, tmp_Counter	        :       DZ      'F5  : Старые значения              PU/PD/+/- : Изменение'
 _mSetStrRus setupHelpStr4, tmp_Counter	        :       DZ      'F7  : Значения по умолчанию               F3 : Цвета '
 _mSetStrRus toSetupButton, tmp_Counter	        :       DZ      '<DEL> для входа в SETUP'
 _mSetStrRus forAltBootButton, tmp_Counter      :       DZ      '<ALT> для Альтернативной загрузки'
 _mSetStrRus cmosChecksumErr, tmp_Counter       :       DZ      'ВНИМАНИЕ! ОШИБКА КОНТРОЛЬНОЙ СУММЫ CMOS, УСТАНОВЛЕНЫ ЗНАЧЕНИЯ ПО УМОЛЧАНИЮ'
 _mSetStrRus cmosDateTimeErr, tmp_Counter       :       DZ      'ВНИМАНИЕ! ОШИБКА ДАТЫ/ВРЕМЕНИ CMOS, УСТАНОВЛЕНЫ ЗНАЧЕНИЯ ПО УМОЛЧАНИЮ'
 _mSetStrRus detectIdePrMA, tmp_Counter	        :       DZ      'Определяем Первичный IDE Master ... [F4 для пропуска] '
 _mSetStrRus detectIdePrSL, tmp_Counter	        :       DZ      'Определяем Первичный IDE Slave  ... [F4 для пропуска] '
 _mSetStrRus detectIdeSecMA, tmp_Counter        :       DZ      'Определяем Вторичный IDE Master ... [F4 для пропуска] '
 _mSetStrRus detectIdeSecSL, tmp_Counter        :       DZ      'Определяем Вторичный IDE Slave  ... [F4 для пропуска] '
 _mSetStrRus ideUnknown, tmp_Counter	        :       DZ      'Неизвестный       '
 _mSetStrRus ideNone, tmp_Counter               :       DZ      'Нет               '
 _mSetStrRus ideSkiped, tmp_Counter             :       DZ      'Пропущен          '
 _mSetStrRus ideFail, tmp_Counter               :       DZ      'Не определён      '
 _mSetStrRus spModel, tmp_Counter               :       DZ      'Модель    : '
 _mSetStrRus spMemory, tmp_Counter              :       DZ      'Память    : '
 _mSetStrRus cmosFound, tmp_Counter             :       DZ      'CMOS      : Найден'
 _mSetStrRus cmosNone, tmp_Counter              :       DZ      'CMOS      : Нет'
 _mSetStrRus memoryAvailable, tmp_Counter       :       DZ      'Доступно  : '
; _mSetStrRus unknownSTR1, tmp_Counter          :       DZ      '7"
; _mSetStrRus unknownSTR2, tmp_Counter          :       DZ      '8"
 _mSetStrRus boardID, tmp_Counter               :       DZ      'ID платы  : '
 _mSetStrRus bootFdd, tmp_Counter               :       DZ      'Запуск с дискеты... '
 _mSetStrRus bootHdd, tmp_Counter               :       DZ      'Запуск с HDD на '
 _mSetStrRus bootCd, tmp_Counter                :       DZ      'Запуск с CD-ROM на '
 _mSetStrRus bootRamDrv, tmp_Counter            :       DZ      'Запуск с RAM диска... '
 _mSetStrRus bootRecovery, tmp_Counter          :       DZ      'Запуск восстановления... '
 _mSetStrRus bootAltDrv, tmp_Counter            :       DZ      'Альтернативный '
 _mSetStrRus bootFail, tmp_Counter              :       DZ      'невозможен'
 _mSetStrRus bootOk, tmp_Counter                :       DZ      'OK'
 _mSetStrRus afterBootFail, tmp_Counter         :       DZ      'НАЖМИТЕ <ENTER> ДЛЯ ПЕРЕЗАГРУЗКИ, <DEL> ДЛЯ НАСТРОЕК ИЛИ <ESC> ДЛЯ ZX-MODE . . .'
;
 _mSetStrRus parLang, tmp_Counter               :       DZ      'Язык (Language)            : '
 _mSetStrRus valLangEng, tmp_Counter            :       DZ      'English   '
 _mSetStrRus valLangRus, tmp_Counter            :       DZ      'Русский   '
 _mSetStrRus parMemTest, tmp_Counter            :       DZ      'Тестирование памяти        : '
 _mSetStrRus valDisabled, tmp_Counter           :       DZ      'Отключено'
 _mSetStrRus valEnabled, tmp_Counter            :       DZ      'Включено '
 _mSetStrRus parSaveRAMdrvs, tmp_Counter        :       DZ      'Сохранение RAM-дисков      : '
 _mSetStrRus parUpdBios, tmp_Counter	        :       DZ      'Обновление BIOS            : '
 _mSetStrRus parStartDelay, tmp_Counter	        :       DZ      'Начальное ожидание         : '
 _mSetStrRus valNormal, tmp_Counter             :       DZ      'Обычное  '
 _mSetStrRus parTypRate, tmp_Counter            :       DZ      'Скорость автоповтора       : '
 _mSetStrRus val_6, tmp_Counter                 :       DZ      '6 '
 _mSetStrRus val_8, tmp_Counter                 :       DZ      '8 '
 _mSetStrRus val_10, tmp_Counter                :       DZ      '10'
 _mSetStrRus val_12, tmp_Counter                :       DZ      '12'
 _mSetStrRus val_15, tmp_Counter                :       DZ      '15'
 _mSetStrRus val_20, tmp_Counter                :       DZ      '20'
 _mSetStrRus val_24, tmp_Counter                :       DZ      '24'
 _mSetStrRus val_30, tmp_Counter                :       DZ      '30'
 _mSetStrRus parTypDelay, tmp_Counter           :       DZ      'Задержка автоповтора (Мсек): '
 _mSetStrRus val_250, tmp_Counter               :       DZ      '250 '
 _mSetStrRus val_500, tmp_Counter               :       DZ      '500 '
 _mSetStrRus val_750, tmp_Counter               :       DZ      '750 '
 _mSetStrRus val_1000, tmp_Counter              :       DZ      '1000'
 _mSetStrRus parRebootMsg, tmp_Counter          :       DZ      'Сообщение о перезагрузке   : '
 _mSetStrRus parSysDsk, tmp_Counter             :       DZ      'Системный диск             : '
 _mSetStrRus val1stFDD, tmp_Counter             :       DZ      '1-ый FDD'
 _mSetStrRus val2ndFDD, tmp_Counter             :       DZ      '2-ой FDD'
 _mSetStrRus val1stIDE, tmp_Counter             :       DZ      '1-ый IDE'
 _mSetStrRus val2ndIDE, tmp_Counter             :       DZ      '2-ой IDE'
 _mSetStrRus val3rdIDE, tmp_Counter             :       DZ      '3-ий IDE'
 _mSetStrRus val4thIDE, tmp_Counter             :       DZ      '4-ый IDE'
 _mSetStrRus valRamDsk, tmp_Counter             :       DZ      'RAM-DISK'
 _mSetStrRus valRecovery, tmp_Counter           :       DZ      'RECOVERY'
 _mSetStrRus parAltSysDsk, tmp_Counter          :       DZ      'Алт. Системный диск        : '
 _mSetStrRus parFddFirst, tmp_Counter           :       DZ      'FDD первый                 : '
 _mSetStrRus valAuto, tmp_Counter               :       DZ      'Авто  '
; _mSetStrRus val720, tmp_Counter               :       DZ      '720K  '
; _mSetStrRus val1440, tmp_Counter              :       DZ      '1.44M '
 _mSetStrRus valDash6, tmp_Counter              :       DZ      '------'
 _mSetStrRus parFddSecond, tmp_Counter          :       DZ      'FDD второй                 : '
 _mSetStrRus parPriIdeMA, tmp_Counter           :       DZ      'Primary IDE Master         : '
 _mSetStrRus valSetup, tmp_Counter              :       DZ      'Setup '
 _mSetStrRus valCdRom, tmp_Counter              :       DZ      'CD-ROM'
 _mSetStrRus parPriIdeSl, tmp_Counter           :       DZ      'Primary IDE Slave          : '
 _mSetStrRus parSecIdeMA, tmp_Counter           :       DZ      'Secondary IDE Master       : '
 _mSetStrRus parSecIdeSl, tmp_Counter           :       DZ      'Secondary IDE Slave        : '
 IF HDDwriteProtect
  _mSetStrRus parHddWrPr, tmp_Counter		:	DZ	'Защита записи на HDD       : '
 ENDIF
 _mSetStrRus parScreenY, tmp_Counter            :       DZ      'Сдвиг экрана по Y   : '
 _mSetStrRus valMinus7, tmp_Counter             :       DZ      '-7'
 _mSetStrRus valMinus6, tmp_Counter             :       DZ      '-6'
 _mSetStrRus valMinus5, tmp_Counter             :       DZ      '-5'
 _mSetStrRus valMinus4, tmp_Counter             :       DZ      '-4'
 _mSetStrRus valMinus3, tmp_Counter             :       DZ      '-3'
 _mSetStrRus valMinus2, tmp_Counter             :       DZ      '-2'
 _mSetStrRus valMinus1, tmp_Counter             :       DZ      '-1'
 _mSetStrRus val_0, tmp_Counter	                :       DZ      ' 0'
 _mSetStrRus valPlus1, tmp_Counter              :       DZ      '+1'
 _mSetStrRus valPlus2, tmp_Counter              :       DZ      '+2'
 _mSetStrRus valPlus3, tmp_Counter              :       DZ      '+3'
 _mSetStrRus valPlus4, tmp_Counter              :       DZ      '+4'
 _mSetStrRus valPlus5, tmp_Counter              :       DZ      '+5'
 _mSetStrRus valPlus6, tmp_Counter              :       DZ      '+6'
 _mSetStrRus valPlus7, tmp_Counter              :       DZ      '+7'
  _mSetStrRus parScreenX, tmp_Counter           :       DZ      'Сдвиг экрана по X   : '
 _mSetStrRus parFrameInt, tmp_Counter           :       DZ      'Кадровое прерывание : '
 _mSetStrRus valDash8, tmp_Counter              :       DZ      '--------'
 _mSetStrRus valScorpion, tmp_Counter           :       DZ      'Скорпион'
 _mSetStrRus valPentagon, tmp_Counter           :       DZ      'Пентагон'
 _mSetStrRus valSpectrum, tmp_Counter           :       DZ      'Спектрум'
 _mSetStrRus parVSync, tmp_Counter              :       DZ      'Верт. синхронизация : '
 _mSetStrRus val312_50, tmp_Counter             :       DZ      '312/50Гц'
 _mSetStrRus val320_49, tmp_Counter             :       DZ      '320/49Гц'
 _mSetStrRus parQuickStartROM, tmp_Counter      :       DZ      'Быстрый запуск ПЗУ  : '
 _mSetStrRus parTrDosA, tmp_Counter             :       DZ      'TR DOS A:>          : '
 _mSetStrRus valDefault, tmp_Counter            :       DZ      'По умолчанию'
 _mSetStrRus valFDD, tmp_Counter                :       DZ      'FDD         '
 _mSetStrRus valHDD, tmp_Counter                :       DZ      'HDD         '
 _mSetStrRus parTrDosB, tmp_Counter             :       DZ      'TR DOS B:>          : '
 _mSetStrRus parTrDosC, tmp_Counter             :       DZ      'TR DOS C:>          : '
 _mSetStrRus parTrDosD, tmp_Counter             :       DZ      'TR DOS D:>          : '
 IF NEW_FEATURE
 _mSetStrRus parSetTime, tmp_Counter            :       DZ      'Дата и время        : '
 _mSetStrRus valFolder, tmp_Counter             :       DB      16,'ВВОД',17,0
 ENDIF
 IF DEBUG
 _mSetStrRus testBIOSmsg, tmp_Counter           :       DZ      'Тестовая сборка! ',BUILD_DATE,', ',__TIME__
 ENDIF
;	
MSG_RUS:
	_mCreateMsgAddrTable
MSG_RUS.size     EQU $-MSG_RUS
;==================================================================================================================================
	ASSERT MSG_ENG.size = MSG_RUS.size, "ERROR IN MESSAGE STRINGS: RUS and ENG do not match"
;
;