mirror of
https://github.com/Tolik-Trek/Shared_Includes.git
synced 2026-06-15 17:11:33 +03:00
к функциям LUA добавлена increase_build
This commit is contained in:
parent
53ae29d127
commit
eb8e552623
@ -406,3 +406,26 @@ function Generate_DCPASM_fromPAGE (DCP_Page_file, DCP_new_ASM)
|
|||||||
assert(DCP_TABLE_CODE:close())
|
assert(DCP_TABLE_CODE:close())
|
||||||
end
|
end
|
||||||
-- []===========================[]
|
-- []===========================[]
|
||||||
|
|
||||||
|
|
||||||
|
-- []===========================[]
|
||||||
|
-- Function reads number from file <fname>, increases it, creates define "BUILD" with the number and saves the number to <fname>.
|
||||||
|
-- With this function you can control count of compilations.
|
||||||
|
function increase_build(fname)
|
||||||
|
local fp
|
||||||
|
local build
|
||||||
|
fp = assert(io.open(fname, "rb"))
|
||||||
|
build = tonumber(fp:read("*all"))
|
||||||
|
assert(fp:close())
|
||||||
|
if type(build) == "nil" then
|
||||||
|
build = 0
|
||||||
|
end
|
||||||
|
build = build + 1;
|
||||||
|
--sj.insert_define("BUILD", build)
|
||||||
|
fp = assert(io.open(fname, "wb"))
|
||||||
|
assert(fp:write(build))
|
||||||
|
assert(fp:flush())
|
||||||
|
assert(fp:close())
|
||||||
|
return build
|
||||||
|
end
|
||||||
|
-- []===========================[]
|
||||||
@ -1,7 +1,7 @@
|
|||||||
;
|
;
|
||||||
;***************************************
|
;***************************************
|
||||||
ORG org_addr - exe_header.length
|
ORG org_addr - exe_header.length
|
||||||
exe_header equ $
|
exe_header:
|
||||||
BYTE 'EXE' ; 0-3 EXE ‘¨£ âãà
|
BYTE 'EXE' ; 0-3 EXE ‘¨£ âãà
|
||||||
BYTE 0 ; 4 Version of EXE file
|
BYTE 0 ; 4 Version of EXE file
|
||||||
DWORD exe_header.length ; 5-6 ‘ ª ª®£® á¬¥é¥¨ï ¢ ä ©«¥ ¡ã¤¥â £à㧨âìáï ª®¤ ¢
|
DWORD exe_header.length ; 5-6 ‘ ª ª®£® á¬¥é¥¨ï ¢ ä ©«¥ ¡ã¤¥â £à㧨âìáï ª®¤ ¢
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user