From eb8e55262317fea366bfb6b7d834dde90ff7307b Mon Sep 17 00:00:00 2001 From: Anatoliy Belyanskiy Date: Sat, 15 Jul 2023 05:03:04 +1000 Subject: [PATCH] =?UTF-8?q?=D0=BA=20=D1=84=D1=83=D0=BD=D0=BA=D1=86=D0=B8?= =?UTF-8?q?=D1=8F=D0=BC=20LUA=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20increase=5Fbuild?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LUA/Functions.lua | 23 +++++++++++++++++++++++ constants/EXE_Header.z80 | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/LUA/Functions.lua b/LUA/Functions.lua index 84984d0..5475ea8 100644 --- a/LUA/Functions.lua +++ b/LUA/Functions.lua @@ -405,4 +405,27 @@ function Generate_DCPASM_fromPAGE (DCP_Page_file, DCP_new_ASM) assert(DCP_TABLE_CODE:flush()) assert(DCP_TABLE_CODE:close()) end +-- []===========================[] + + +-- []===========================[] + -- Function reads number from file , increases it, creates define "BUILD" with the number and saves the number to . + -- 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 -- []===========================[] \ No newline at end of file diff --git a/constants/EXE_Header.z80 b/constants/EXE_Header.z80 index 4a1237a..c9cbe48 100644 --- a/constants/EXE_Header.z80 +++ b/constants/EXE_Header.z80 @@ -1,7 +1,7 @@ ; ;*************************************** ORG org_addr - exe_header.length -exe_header equ $ +exe_header: BYTE 'EXE' ; 0-3 EXE Сигнатура BYTE 0 ; 4 Version of EXE file DWORD exe_header.length ; 5-6 С какого смещения в файле будет грузиться код в