diff --git a/data/Tupfile.lua b/data/Tupfile.lua index ec8897e25..b5cb3ef43 100644 --- a/data/Tupfile.lua +++ b/data/Tupfile.lua @@ -418,25 +418,25 @@ tup.append_table(img_files, { {"COLRDIAL", VAR_PROGS .. "/system/colrdial/color_dialog"}, {"CROPFLAT", VAR_PROGS .. "/system/cropflat/cropflat"}, {"CPU", VAR_PROGS .. "/system/cpu/cpu"}, - {"CPUID", VAR_PROGS .. "/testing/cpuid/trunk/CPUID"}, + {"CPUID", VAR_PROGS .. "/testing/cpuid/CPUID"}, {"DOCPACK", VAR_PROGS .. "/system/docpack/docpack"}, {"DEFAULT.SKN", VAR_SKINS .. "/../skins/Leency/Shkvorka/Shkvorka.skn"}, - {"DISPTEST", VAR_PROGS .. "/testing/disptest/trunk/disptest"}, + {"DISPTEST", VAR_PROGS .. "/testing/disptest/disptest"}, {"END", VAR_PROGS .. "/system/end/light/end"}, {"ESKIN", VAR_PROGS .. "/system/eskin/eskin"}, {"FSPEED", VAR_PROGS .. "/testing/fspeed/fspeed"}, {"GMON", VAR_PROGS .. "/system/gmon/gmon"}, {"HDD_INFO", VAR_PROGS .. "/system/hdd_info/hdd_info"}, - {"KBD", VAR_PROGS .. "/testing/kbd/trunk/kbd"}, + {"KBD", VAR_PROGS .. "/testing/kbd/kbd"}, {"KPACK", VAR_PROGS .. "/other/kpack/trunk/kpack"}, {"LAUNCHER", VAR_PROGS .. "/system/launcher/launcher"}, {"LOADDRV", VAR_PROGS .. "/system/loaddrv/loaddrv"}, {"MAGNIFY", VAR_PROGS .. "/system/magnify/magnify"}, - {"MGB", VAR_PROGS .. "/testing/mgb/trunk/mgb"}, + {"MGB", VAR_PROGS .. "/testing/mgb/mgb"}, {"MOUSEMUL", VAR_PROGS .. "/system/mousemul/mousemul"}, {"MADMOUSE", VAR_PROGS .. "/other/madmouse/madmouse"}, {"MYKEY", VAR_PROGS .. "/system/MyKey/MyKey"}, - {"PCIDEV", VAR_PROGS .. "/testing/pcidev/trunk/PCIDEV"}, + {"PCIDEV", VAR_PROGS .. "/testing/pcidev/PCIDEV"}, {"RDSAVE", VAR_PROGS .. "/system/rdsave/rdsave"}, {"RTFREAD", VAR_PROGS .. "/other/rtfread/rtfread"}, {"SEARCHAP", VAR_PROGS .. "/system/searchap/searchap"}, @@ -444,7 +444,7 @@ tup.append_table(img_files, { {"SETUP", VAR_PROGS .. "/system/setup/setup"}, {"SKINCFG", VAR_PROGS .. "/system/skincfg/skincfg"}, {"TERMINAL", VAR_PROGS .. "/system/terminal/terminal"}, - {"TEST", VAR_PROGS .. "/testing/protection/trunk/test"}, + {"TEST", VAR_PROGS .. "/testing/protection/test"}, {"TINYPAD", VAR_PROGS .. "/develop/tinypad/tinypad"}, {"TINFO", VAR_PROGS .. "/system/tinfo/tinfo"}, {"TIMER", VAR_PROGS .. "/other/Timer/Timer"}, diff --git a/programs/build_all.bat b/programs/build_all.bat index ca8cb4cf8..671ea7d77 100644 --- a/programs/build_all.bat +++ b/programs/build_all.bat @@ -60,19 +60,19 @@ fasm system\calendar\calendar.asm %BIN%\calendar fasm system\board\board.asm %BIN%\develop\board rem fasm system\commouse\trunk\commouse.asm %BIN%\commouse fasm system\cpu\cpu.asm %BIN%\cpu -rem fasm system\cpuid\trunk\cpuid.asm %BIN%\cpuid +fasm testing\cpuid\cpuid.asm %BIN%\cpuid fasm system\skincfg\skincfg.asm %BIN%\skincfg fasm system\docpack\docpack.asm %BIN%\docpack fasm system\end\end.asm %BIN%\end fasm system\gmon\gmon.asm %BIN%\gmon fasm system\icon\icon.asm %BIN%\icon -rem fasm system\kbd\trunk\kbd.ASM %BIN%\kbd +fasm testing\kbd\kbd.ASM %BIN%\kbd fasm system\launcher\launcher.asm %BIN%\launcher fasm system\menu\menu.asm %BIN%\@menu -rem fasm system\mgb\trunk\mgb.asm %BIN%\mgb +fasm testing\mgb\mgb.asm %BIN%\mgb fasm system\mousemul\mousemul.asm %BIN%\mousemul fasm system\taskbar\TASKBAR.ASM %BIN%\@TASKBAR -rem fasm system\pcidev\trunk\pcidev.asm %BIN%\pcidev +fasm testing\pcidev\pcidev.asm %BIN%\pcidev rem fasm system\RB\trunk\@RB.ASM %BIN%\@RB fasm system\rdsave\rdsave.asm %BIN%\rdsave fasm system\run\run.asm %BIN%\run @@ -238,7 +238,7 @@ fasm develop\heed\heed.asm %BIN%\nightbuild\heed fasm develop\tinypad\tinypad.asm %BIN%\nightbuild\tinypad fasm system\skincfg\skincfg.asm %BIN%\nightbuild\skincfg fasm system\hdd_info\hdd_info.asm %BIN%\nightbuild\hdd_info -rem fasm system\mgb\trunk\mgb.asm %BIN%\nightbuild\mgb +fasm testing\mgb\mgb.asm %BIN%\nightbuild\mgb fasm system\rdsave\rdsave.asm %BIN%\nightbuild\rdsave fasm other\kpack\trunk\kpack.asm %BIN%\nightbuild\kpack fasm other\rtfread\rtfread.asm %BIN%\nightbuild\rtfread diff --git a/programs/testing/cpuid/trunk/Build.bat b/programs/testing/cpuid/Build.bat similarity index 100% rename from programs/testing/cpuid/trunk/Build.bat rename to programs/testing/cpuid/Build.bat diff --git a/programs/testing/cpuid/trunk/CPUID.ASM b/programs/testing/cpuid/CPUID.ASM similarity index 99% rename from programs/testing/cpuid/trunk/CPUID.ASM rename to programs/testing/cpuid/CPUID.ASM index 355471553..c703eb04b 100644 --- a/programs/testing/cpuid/trunk/CPUID.ASM +++ b/programs/testing/cpuid/CPUID.ASM @@ -1,3 +1,6 @@ +; SPDX-License-Identifier: NOASSERTION +; + ;****************************************************************************** ; project name: CPUID * ; platform: KolibriOS, x86 (IA-32), x86-64 achitectures * @@ -15,8 +18,7 @@ ; your changes to the maintainer or make about post changes * ; at forum http://board.kolibrios.org/viewtopic.php?f=42&t=594* ;-----------------------------------------------------------------------------* -; English comments * -;------------------------------------------------------------------------------ + use32 org 0x0 db 'MENUET01' @@ -28,10 +30,10 @@ use32 dd 0x0 dd path -include '..\..\..\develop\libraries\box_lib\load_lib.mac' -include '..\..\..\macros.inc' -include '../../../gui_patterns.inc' -include '../../../KOSfuncs.inc' +include '../../develop/libraries/box_lib/load_lib.mac' +include '../../macros.inc' +include '../../gui_patterns.inc' +include '../../KOSfuncs.inc' include 'lang.inc' ; Language support for locales: it_IT, en_US. include 'draw.inc' include 'brand.inc' ; brand ID decoding diff --git a/programs/testing/cpuid/trunk/HISTORY.TXT b/programs/testing/cpuid/HISTORY.TXT similarity index 100% rename from programs/testing/cpuid/trunk/HISTORY.TXT rename to programs/testing/cpuid/HISTORY.TXT diff --git a/programs/testing/cpuid/trunk/README.TXT b/programs/testing/cpuid/README.TXT similarity index 100% rename from programs/testing/cpuid/trunk/README.TXT rename to programs/testing/cpuid/README.TXT diff --git a/programs/testing/cpuid/trunk/Tupfile.lua b/programs/testing/cpuid/Tupfile.lua similarity index 80% rename from programs/testing/cpuid/trunk/Tupfile.lua rename to programs/testing/cpuid/Tupfile.lua index 517b723de..92e308355 100644 --- a/programs/testing/cpuid/trunk/Tupfile.lua +++ b/programs/testing/cpuid/Tupfile.lua @@ -1,5 +1,5 @@ if tup.getconfig("NO_FASM") ~= "" then return end -HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../../.." or tup.getconfig("HELPERDIR") +HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../.." or tup.getconfig("HELPERDIR") tup.include(HELPERDIR .. "/use_fasm.lua") add_include(tup.getvariantdir()) diff --git a/programs/testing/cpuid/trunk/amd.gif b/programs/testing/cpuid/amd.gif similarity index 100% rename from programs/testing/cpuid/trunk/amd.gif rename to programs/testing/cpuid/amd.gif diff --git a/programs/testing/cpuid/trunk/brand.inc b/programs/testing/cpuid/brand.inc similarity index 100% rename from programs/testing/cpuid/trunk/brand.inc rename to programs/testing/cpuid/brand.inc diff --git a/programs/testing/cpuid/trunk/caches.inc b/programs/testing/cpuid/caches.inc similarity index 100% rename from programs/testing/cpuid/trunk/caches.inc rename to programs/testing/cpuid/caches.inc diff --git a/programs/testing/cpuid/trunk/cyrix.gif b/programs/testing/cpuid/cyrix.gif similarity index 100% rename from programs/testing/cpuid/trunk/cyrix.gif rename to programs/testing/cpuid/cyrix.gif diff --git a/programs/testing/cpuid/trunk/draw.inc b/programs/testing/cpuid/draw.inc similarity index 100% rename from programs/testing/cpuid/trunk/draw.inc rename to programs/testing/cpuid/draw.inc diff --git a/programs/testing/cpuid/trunk/features.inc b/programs/testing/cpuid/features.inc similarity index 100% rename from programs/testing/cpuid/trunk/features.inc rename to programs/testing/cpuid/features.inc diff --git a/programs/testing/cpuid/trunk/gif_lite.inc b/programs/testing/cpuid/gif_lite.inc similarity index 100% rename from programs/testing/cpuid/trunk/gif_lite.inc rename to programs/testing/cpuid/gif_lite.inc diff --git a/programs/testing/cpuid/trunk/idt.gif b/programs/testing/cpuid/idt.gif similarity index 100% rename from programs/testing/cpuid/trunk/idt.gif rename to programs/testing/cpuid/idt.gif diff --git a/programs/testing/cpuid/trunk/intel.gif b/programs/testing/cpuid/intel.gif similarity index 100% rename from programs/testing/cpuid/trunk/intel.gif rename to programs/testing/cpuid/intel.gif diff --git a/programs/testing/cpuid/trunk/logos.inc b/programs/testing/cpuid/logos.inc similarity index 100% rename from programs/testing/cpuid/trunk/logos.inc rename to programs/testing/cpuid/logos.inc diff --git a/programs/testing/cpuid/trunk/makefile b/programs/testing/cpuid/makefile similarity index 100% rename from programs/testing/cpuid/trunk/makefile rename to programs/testing/cpuid/makefile diff --git a/programs/testing/cpuid/trunk/multipli.inc b/programs/testing/cpuid/multipli.inc similarity index 100% rename from programs/testing/cpuid/trunk/multipli.inc rename to programs/testing/cpuid/multipli.inc diff --git a/programs/testing/cpuid/trunk/rsatest.inc b/programs/testing/cpuid/rsatest.inc similarity index 100% rename from programs/testing/cpuid/trunk/rsatest.inc rename to programs/testing/cpuid/rsatest.inc diff --git a/programs/testing/cpuid/trunk/transmet.gif b/programs/testing/cpuid/transmet.gif similarity index 100% rename from programs/testing/cpuid/trunk/transmet.gif rename to programs/testing/cpuid/transmet.gif diff --git a/programs/testing/cpuid/trunk/variable.inc b/programs/testing/cpuid/variable.inc similarity index 100% rename from programs/testing/cpuid/trunk/variable.inc rename to programs/testing/cpuid/variable.inc diff --git a/programs/testing/cpuid/trunk/via.gif b/programs/testing/cpuid/via.gif similarity index 100% rename from programs/testing/cpuid/trunk/via.gif rename to programs/testing/cpuid/via.gif diff --git a/programs/testing/cpuid/trunk/vortex.gif b/programs/testing/cpuid/vortex.gif similarity index 100% rename from programs/testing/cpuid/trunk/vortex.gif rename to programs/testing/cpuid/vortex.gif diff --git a/programs/testing/disptest/trunk/Tupfile.lua b/programs/testing/disptest/Tupfile.lua similarity index 79% rename from programs/testing/disptest/trunk/Tupfile.lua rename to programs/testing/disptest/Tupfile.lua index 8362dae32..a479af5d6 100644 --- a/programs/testing/disptest/trunk/Tupfile.lua +++ b/programs/testing/disptest/Tupfile.lua @@ -1,5 +1,5 @@ if tup.getconfig("NO_FASM") ~= "" then return end -HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../../.." or tup.getconfig("HELPERDIR") +HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../.." or tup.getconfig("HELPERDIR") tup.include(HELPERDIR .. "/use_fasm.lua") add_include(tup.getvariantdir()) diff --git a/programs/testing/disptest/trunk/build_en.bat b/programs/testing/disptest/build_en.bat similarity index 100% rename from programs/testing/disptest/trunk/build_en.bat rename to programs/testing/disptest/build_en.bat diff --git a/programs/testing/disptest/trunk/build_ru.bat b/programs/testing/disptest/build_ru.bat similarity index 100% rename from programs/testing/disptest/trunk/build_ru.bat rename to programs/testing/disptest/build_ru.bat diff --git a/programs/testing/disptest/trunk/disptest.ASM b/programs/testing/disptest/disptest.ASM similarity index 99% rename from programs/testing/disptest/trunk/disptest.ASM rename to programs/testing/disptest/disptest.ASM index d5f0f5817..0e88bb7f0 100644 --- a/programs/testing/disptest/trunk/disptest.ASM +++ b/programs/testing/disptest/disptest.ASM @@ -1,3 +1,8 @@ +; SPDX-License-Identifier: NOASSERTION +; + +; Text encoded with Code Page 866 - Cyrillic + ;------------------------------------------------------------------------------ ; Display Test for KolibriOS ;------------------------------------------------------------------------------ @@ -13,12 +18,12 @@ ; <--- include all MeOS stuff ---> include "lang.inc" ; Language support for locales: ru_RU (CP866), en_US. -include "../../../macros.inc" +include "../../macros.inc" ; <--- start of MenuetOS application ---> MEOS_APP_START -;include "..\..\..\debug.inc" +;include "../../debug.inc" ; <--- start of code ---> diff --git a/programs/testing/disptest/trunk/readme.txt b/programs/testing/disptest/readme.txt similarity index 100% rename from programs/testing/disptest/trunk/readme.txt rename to programs/testing/disptest/readme.txt diff --git a/programs/testing/kbd/trunk/Tupfile.lua b/programs/testing/kbd/Tupfile.lua similarity index 79% rename from programs/testing/kbd/trunk/Tupfile.lua rename to programs/testing/kbd/Tupfile.lua index 42f3de9af..25226d203 100644 --- a/programs/testing/kbd/trunk/Tupfile.lua +++ b/programs/testing/kbd/Tupfile.lua @@ -1,5 +1,5 @@ if tup.getconfig("NO_FASM") ~= "" then return end -HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../../.." or tup.getconfig("HELPERDIR") +HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../.." or tup.getconfig("HELPERDIR") tup.include(HELPERDIR .. "/use_fasm.lua") add_include(tup.getvariantdir()) diff --git a/programs/testing/kbd/trunk/build.bat b/programs/testing/kbd/build.bat similarity index 100% rename from programs/testing/kbd/trunk/build.bat rename to programs/testing/kbd/build.bat diff --git a/programs/testing/kbd/trunk/kbd.ASM b/programs/testing/kbd/kbd.ASM similarity index 99% rename from programs/testing/kbd/trunk/kbd.ASM rename to programs/testing/kbd/kbd.ASM index 715bb50cc..2974acda8 100644 --- a/programs/testing/kbd/trunk/kbd.ASM +++ b/programs/testing/kbd/kbd.ASM @@ -1,4 +1,9 @@ +; SPDX-License-Identifier: NOASSERTION ; + +; Text encoded with Code Page 866 - Cyrillic + + ; Kolibri Bus Disconnect ; Test for bus disconnect ; @@ -6,7 +11,7 @@ ; ; -include '..\..\..\macros.inc' +include '../../macros.inc' include 'lang.inc' ; Language support for locales: it_IT, en_US. memsize = 1000h @@ -613,4 +618,3 @@ I_END: sc system_colors val_hdd dd ? val_sgd dd ? - diff --git a/programs/testing/kbd/trunk/makefile b/programs/testing/kbd/makefile similarity index 100% rename from programs/testing/kbd/trunk/makefile rename to programs/testing/kbd/makefile diff --git a/programs/testing/kbd/trunk/readme.txt b/programs/testing/kbd/readme.txt similarity index 100% rename from programs/testing/kbd/trunk/readme.txt rename to programs/testing/kbd/readme.txt diff --git a/programs/testing/latency/trunk/Tupfile.lua b/programs/testing/latency/Tupfile.lua similarity index 100% rename from programs/testing/latency/trunk/Tupfile.lua rename to programs/testing/latency/Tupfile.lua diff --git a/programs/testing/latency/trunk/build.bat b/programs/testing/latency/build.bat similarity index 100% rename from programs/testing/latency/trunk/build.bat rename to programs/testing/latency/build.bat diff --git a/programs/testing/latency/trunk/latency.asm b/programs/testing/latency/latency.asm similarity index 91% rename from programs/testing/latency/trunk/latency.asm rename to programs/testing/latency/latency.asm index f1f52e868..79c8225bf 100644 --- a/programs/testing/latency/trunk/latency.asm +++ b/programs/testing/latency/latency.asm @@ -1,135 +1,138 @@ - ;; CPU latency test -- Art J ;; - - - use32 ; - org 0x0 ; - - db 'MENUET01' ; - dd 0x01 ; - dd START ; - dd I_END ; - dd 0x4000 ; - dd 0x4000 ; - dd 0x0 ; - dd 0x0 ; - -include '..\..\..\macros.inc' ; - - -START: - - - call draw_win - - - rdtsc - -main_loop: - mov ecx, eax ; ecx = previous timestamp - rdtsc ; new timestamp - cmp eax, ecx - jb main_loop ; tsc overflow? - - mov ebx, eax ; - sub ebx, ecx ; net clocks - - cmp ebx, [max] - jb @f - mov [max], ebx -; mcall 13, 200*65536+60, 500*65536+20, 0x00EEEEEEEE -; mcall 47, 0x800A0001, max, 200*65536+501 -@@: - push ebx - fldlg2 ; lg(2) - fild dword[esp] - fyl2x - fimul [yscale] - fistp dword[esp] - pop ebx ; ebx = lg(time/100) * yscale - sub ebx, [yscale] - sub ebx, [yscale] - jb main_loop - - cmp ebx, 512 - ja main_loop - - mov edx, [ebx*4+data_] - - inc edx - mov [ebx*4+data_], edx - push edx - fld qword[xscale] - fild dword[esp] - fyl2x - fistp dword[esp] - pop edx ; edx = log2(counts) * xscale - cmp edx, 300 - jge main_loop - - shl ebx, 12 ; 1 line = 1024 pixels - add ebx, 1024*4*30 + 17*4 - mov dword[ebx + edx*4 + 0xFE000000], 0x00703030 - jmp main_loop - - - - -;------------------------------------------------ -draw_win: -;------------------------------------------------ - - - mcall 12, 1 - mcall 0, 300, 590, 0x14BAA6A0,,title -; ----------------------------------------------------------------- - mov ecx, [yscale] - shl ecx, 16 - mov cx, word[yscale] - mov [ytick], ecx - mcall 38, 16*65536+16, 30*65536+530, 0 - mov cx, 30 -@@: - mcall , 14*65536+16 - add ecx, [ytick] - cmp cx, 512 - jb @b - - mcall 4, 0x00100230, 0x80000000, advise - mov eax, 47 - mov ebx, 0x00010000 - mov ecx, 2 - mov edx, 7*65536+30 - mov esi, 0 -@@: - mcall - add dx, word[yscale] - inc ecx - cmp dx, 512 - jb @b - - mcall 40, 0xC0000000 ; ignore sys messages - - mcall 12, 2 - - -ret - - -align 4 -;------------------------------------------------- -data_ dd 512 dup 1 ; hysto -max dd 0 -xscale dq 7.2 -yscale dd 80 -ytick dd 0 - - - title db ' Latency test ',0 - advise db 'Use CPU process manager to close this window)',0 - -I_END: ; end of program - - rd 256 - -align 256 -st_0: +; SPDX-License-Identifier: NOASSERTION +; + +; CPU latency test -- Art J + + + use32 ; + org 0x0 ; + + db 'MENUET01' ; + dd 0x01 ; + dd START ; + dd I_END ; + dd 0x4000 ; + dd 0x4000 ; + dd 0x0 ; + dd 0x0 ; + +include '../../macros.inc' ; + + +START: + + + call draw_win + + + rdtsc + +main_loop: + mov ecx, eax ; ecx = previous timestamp + rdtsc ; new timestamp + cmp eax, ecx + jb main_loop ; tsc overflow? + + mov ebx, eax ; + sub ebx, ecx ; net clocks + + cmp ebx, [max] + jb @f + mov [max], ebx +; mcall 13, 200*65536+60, 500*65536+20, 0x00EEEEEEEE +; mcall 47, 0x800A0001, max, 200*65536+501 +@@: + push ebx + fldlg2 ; lg(2) + fild dword[esp] + fyl2x + fimul [yscale] + fistp dword[esp] + pop ebx ; ebx = lg(time/100) * yscale + sub ebx, [yscale] + sub ebx, [yscale] + jb main_loop + + cmp ebx, 512 + ja main_loop + + mov edx, [ebx*4+data_] + + inc edx + mov [ebx*4+data_], edx + push edx + fld qword[xscale] + fild dword[esp] + fyl2x + fistp dword[esp] + pop edx ; edx = log2(counts) * xscale + cmp edx, 300 + jge main_loop + + shl ebx, 12 ; 1 line = 1024 pixels + add ebx, 1024*4*30 + 17*4 + mov dword[ebx + edx*4 + 0xFE000000], 0x00703030 + jmp main_loop + + + + +;------------------------------------------------ +draw_win: +;------------------------------------------------ + + + mcall 12, 1 + mcall 0, 300, 590, 0x14BAA6A0,,title +; ----------------------------------------------------------------- + mov ecx, [yscale] + shl ecx, 16 + mov cx, word[yscale] + mov [ytick], ecx + mcall 38, 16*65536+16, 30*65536+530, 0 + mov cx, 30 +@@: + mcall , 14*65536+16 + add ecx, [ytick] + cmp cx, 512 + jb @b + + mcall 4, 0x00100230, 0x80000000, advise + mov eax, 47 + mov ebx, 0x00010000 + mov ecx, 2 + mov edx, 7*65536+30 + mov esi, 0 +@@: + mcall + add dx, word[yscale] + inc ecx + cmp dx, 512 + jb @b + + mcall 40, 0xC0000000 ; ignore sys messages + + mcall 12, 2 + + +ret + + +align 4 +;------------------------------------------------- +data_ dd 512 dup 1 ; hysto +max dd 0 +xscale dq 7.2 +yscale dd 80 +ytick dd 0 + + + title db ' Latency test ',0 + advise db 'Use CPU process manager to close this window)',0 + +I_END: ; end of program + + rd 256 + +align 256 +st_0: diff --git a/programs/testing/latency/trunk/makefile b/programs/testing/latency/makefile similarity index 100% rename from programs/testing/latency/trunk/makefile rename to programs/testing/latency/makefile diff --git a/programs/testing/mgb/trunk/Tupfile.lua b/programs/testing/mgb/Tupfile.lua similarity index 79% rename from programs/testing/mgb/trunk/Tupfile.lua rename to programs/testing/mgb/Tupfile.lua index e9c80af5f..1dc1d9797 100644 --- a/programs/testing/mgb/trunk/Tupfile.lua +++ b/programs/testing/mgb/Tupfile.lua @@ -1,5 +1,5 @@ if tup.getconfig("NO_FASM") ~= "" then return end -HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../../.." or tup.getconfig("HELPERDIR") +HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../.." or tup.getconfig("HELPERDIR") tup.include(HELPERDIR .. "/use_fasm.lua") add_include(tup.getvariantdir()) diff --git a/programs/testing/mgb/trunk/build.bat b/programs/testing/mgb/build.bat similarity index 100% rename from programs/testing/mgb/trunk/build.bat rename to programs/testing/mgb/build.bat diff --git a/programs/testing/mgb/trunk/build.sh b/programs/testing/mgb/build.sh similarity index 100% rename from programs/testing/mgb/trunk/build.sh rename to programs/testing/mgb/build.sh diff --git a/programs/testing/mgb/trunk/makefile b/programs/testing/mgb/makefile similarity index 100% rename from programs/testing/mgb/trunk/makefile rename to programs/testing/mgb/makefile diff --git a/programs/testing/mgb/trunk/mgb.asm b/programs/testing/mgb/mgb.asm similarity index 94% rename from programs/testing/mgb/trunk/mgb.asm rename to programs/testing/mgb/mgb.asm index 9d6fc4335..32f09a915 100644 --- a/programs/testing/mgb/trunk/mgb.asm +++ b/programs/testing/mgb/mgb.asm @@ -1,1201 +1,1207 @@ -;============================================================================= -; Kolibri Graphics Benchmark 0.9 -;-------------------------------------- -; MGB - Menuet Graphics Benchmark 0.3 -; Compile with FASM -; -;============================================================================= -; version: 0.9 -; last update: 15/04/2019 -; written by: Kiril Lipatov aka Leency -; changes: use big fonts, editing two comments, improve UI, show delta % -; Russian translation by Daniel Ovchinnikov -;--------------------------------------------------------------------- -; version: 0.82 -; last update: 03/11/2014 -; written by: Marat Zakiyanov aka Mario79, aka Mario -; changes: fix "benchmark GS selector" for 16bpp (support SVN r.5154) -;--------------------------------------------------------------------- -; version: 0.81 -; last update: 01/05/2014 -; written by: Marat Zakiyanov aka Mario79, aka Mario -; changes: fix "benchmark GS selector" for some display sizes -; (for example, 1366 by horizontal) and code optimization -;--------------------------------------------------------------------- -; version: 0.8 -; last update: 08/07/2013 -; written by: Marat Zakiyanov aka Mario79, aka Mario -; changes: benchmark f4 with memory + f65 -;--------------------------------------------------------------------- -; version: 0.7 -; last update: 05/04/2013 -; written by: Marat Zakiyanov aka Mario79, aka Mario -; changes: benchmark GS selector - read screen area -;--------------------------------------------------------------------- -; version: 0.6 -; last update: 14/03/2013 -; written by: Marat Zakiyanov aka Mario79, aka Mario -; changes: benchmark f36 - read screen area -;--------------------------------------------------------------------- -; version: 0.5 -; last update: 05/03/2013 -; written by: Marat Zakiyanov aka Mario79, aka Mario -; changes: benchmark f73-blitter -;--------------------------------------------------------------------- -; version: 0.4 -; last update: 18/09//2010 -; written by: Marat Zakiyanov aka Mario79, aka Mario -; changes: select path with OpenDialog, -; use of Box_Lib and Proc_Lib, -; support start with path for *.mgb file -; optimization code and size of use memory -;--------------------------------------------------------------------- -; Original author and copyrights holder: -; Mikhail Lisovin a.k.a. Mihasik -; lisovin@26.ru -; -; Disassembled with IDA 5.0.0.879: -; http://www.datarescue.com/ -; With use of 'ida.int' and 'kloader.ldw': -; Eugene Grechnikov a.k.a. diamond -; diamondz@land.ru -; http://diamondz.land.ru/ -; -; Modified for version 0.3: -; Mike Semenako a.k.a mike.dld -; mike.dld@gmail.com -; http://www.mikedld.com/ -; -;============================================================================= - -org 0x0 -use32 - - db 'MENUET01' - dd 1 - dd start - dd IM_END - dd I_END ;0x200000 - dd stacktop ;0x07FFF0 - dd fname_buf - dd cur_dir_path - -include '../../../config.inc' ;for nightbuild -include '../../../macros.inc' -include '../../../proc32.inc' -;include '../../../debug.inc' -include '../../../develop/libraries/box_lib/trunk/box_lib.mac' -include '../../../develop/libraries/box_lib/load_lib.mac' -include 'lang.inc' ;language support - @use_library -;--------------------------------------------------------------------- -start: - mcall 68,11 - - mcall 68,12,8+9*6*38*4 ; 7352 - mov [text_scren_buffer],eax - - mcall 68,12,8+9*6*38*4 ; 8216 - mov [text_scren_buffer2],eax - -load_libraries l_libs_start,end_l_libs - - cmp eax,-1 - jz close -;--------------------------------------------------------------------- - mov edi,filename_area - mov esi,start_temp_file_name - call copy_str_1 - - mov edi,comment_string_1 - mov esi,aComment1 - call copy_str_1 - - mov edi,comment_string_2 - mov esi,aComment2 - call copy_str_1 - - mov edi,fname_buf - cmp [edi],byte 0 - jne @f - mov esi,path4 - call copy_str_1 - jmp .OpenDialog -@@: - call locLoadFile - xor dword [wFlags],1 -.OpenDialog: -;OpenDialog initialisation - push dword OpenDialog_data - call [OpenDialog_Init] -;--------------------------------------------------------------------- - mcall 40,0x80000027 -red: - call draw_window -still: - mcall 10 - cmp eax,1 - jz red - cmp eax,2 - jz key - cmp eax,3 - jz button - jmp still -;--------------------------------------------------------------------- -copy_str_1: - xor eax,eax - cld -@@: - lodsb - stosb - test eax,eax - jnz @b - ret -;--------------------------------------------------------------------- -key: - mcall 2 - cmp ah,'t' - jz ActionTest - cmp ah,'c' - jz ActionComment - cmp ah,'m' - jz ActionPatternMove - cmp ah,'o' - jz ActionOpen - cmp ah,'s' - jz ActionSave - jmp still -;--------------------------------------------------------------------- -button: - mcall 17 - cmp ah,1 - jnz NotClose -close: - mcall -1 -NotClose: - cmp ah,2 - jnz locNotTest -ActionTest: - test dword [wFlags],1 - jnz still - mcall 51,1,TestWndProc,thread_stack1 - jmp still -;--------------------------------------------------------------------- -locNotTest: - cmp ah,3 - jnz NotComment -ActionComment: - test dword [wFlags],1 - jnz still - mcall 51,1,thread_comment,thread_stack2 - jmp still -;--------------------------------------------------------------------- -NotComment: - cmp ah,6 - jnz NotPatternCopy -ActionPatternMove: - test dword [wFlags],1 - jnz still - mov esi,results_table - cld -@@: - lodsd - mov [esi],eax - add esi,TEST_REC_SIZE-4 - cmp dword [esi+TEST_REC_SIZE-4],0 - jne @b - mov esi,comment_string_1 - mov edi,comment_string_2 - call copy_str_1 - call DrawBars - jmp still -;--------------------------------------------------------------------- -NotPatternCopy: - cmp ah,4 - jnz NotOpen -ActionOpen: - test dword [wFlags],1 - jnz still - mov [OpenDialog_data.type],0 ; open - call OpenDialog_Start_1 - jne still - call locLoadFile - call DrawBars -.1: - xor dword [wFlags],1 - jmp still -;--------------------------------------------------------------------- -OpenDialog_Start_1: - push dword OpenDialog_data - call [OpenDialog_Start] - cmp [OpenDialog_data.status],1 - ret -;--------------------------------------------------------------------- -NotOpen: - cmp ah,5 - jnz still -ActionSave: - test dword [wFlags],1 - jnz still - mov [OpenDialog_data.type],1 ; save - call OpenDialog_Start_1 - jne still - call locSaveFile - jmp ActionOpen.1 -;--------------------------------------------------------------------- -TestWndProc: - mcall 68,12,90*123*3 - mov [area_for_f36],eax - or dword [wFlags],1 - mov esi,results_table+8 -align 4 -.next_test: - xor edi,edi - mcall 26,9 - inc eax - mov ecx,eax - add eax,100 - mov [dwTestEndTime],eax -align 4 -@@: - mcall 26 - cmp eax,ecx - jb @r -align 4 -@@: - push esi edi - call dword [esi] - pop edi esi - inc edi - mcall 26,9 - cmp eax,[dwTestEndTime] - jb @b - mov [esi-8],edi - - add esi,TEST_REC_SIZE - cmp dword [esi], testDrawPicture_f73 - jnz @f - call prepare_f73 -@@: - cmp dword [esi],0 - jnz .next_test - xor dword [wFlags],1 - mcall 68,13,[area_for_f36] - mcall -1 -;--------------------------------------------------------------------- -draw_window: - mcall 12,1 - mcall 48,4 - mov ebx,460*65536+(LINE_DESCRIPTION_CHARS+5)*8+16 - mov ecx,80*65536+TESTS_NUM*(LINE_HEIGHT+2)+15+38 - add cx,ax - xor eax,eax - xor esi,esi - mcall ,,,34000000h,,aCaption - - mov eax,8 - mov ebx,20*65536+84 - mov ecx,4*65536+24 - mov edx,2 - mov esi,0x00007F7F -@@: - mcall - add ebx,96*65536 - inc edx - cmp edx,7 - jb @r - - mov ecx,33 - mov edx,0x00007F7F - mov esi,(LINE_DESCRIPTION_CHARS*8)/2+20 - call drawSeparator - - mcall 4,<46,9>,0x90DDEEFF,aButtonsText - call DrawBars - - mov ecx,TESTS_NUM*LINE_HEIGHT+15+23 - mov edx,0x00007F7F - mov esi,(LINE_DESCRIPTION_CHARS*8)/2+20 - call drawSeparator - mcall 12,2 - ret -;--------------------------------------------------------------------- -drawSeparator: - mov eax,1 - mov ebx,3 -@@: - mcall - add ebx,2 - dec esi - jnz @b - ret -;--------------------------------------------------------------------- -align 4 -testDrawWindow: - xor eax,eax - mcall ,640145h,4F0190h,3000000h - ret -;--------------------------------------------------------------------- -align 4 -testDrawBar: - mcall 13,0A0064h,1E00FAh,6A73D0h - ret -;--------------------------------------------------------------------- -align 4 -testDrawPicture: -; xor ebx,ebx - mcall 7,[area_for_f36],<90,123>,<15,33> - ret -;--------------------------------------------------------------------- -prepare_f73: - mov ecx, 90*123 - mov eax, params_f73.data - mov ebx, [area_for_f36] -@@: - mov edx, [ebx] - and edx, 0xFFFFFF - mov [eax], edx - add ebx, 3 - add eax, 4 - dec ecx - jnz @b - ret -align 4 -testDrawPicture_f73: - xor ebx,ebx - mcall 73,,params_f73 - ret -;--------------------------------------------------------------------- -align 4 -testGetScreen_f36: - xor ebx,ebx - mcall 36,[area_for_f36],<90,123>,<15,33> - ret -;--------------------------------------------------------------------- -GS_start_x = 15 -GS_start_y = 33 -GS_size_x = 90 -GS_size_y = 123 -;----------------------------------------------------------------------------- -align 4 -testGetScreen_GS: - push edi - mov edi,[area_for_f36] - - mcall 61,2 - cmp eax,24 - je get_area_with_GS_24 - - cmp eax,16 - je get_area_with_GS_16 -;----------------------------------------------------------------------------- -align 4 -get_area_with_GS_32: - mcall 61,3 - mov ebx,eax - - mov esi,GS_start_y - imul esi,eax - - mov eax,GS_start_x - shl eax,2 - add esi,eax - - mov ebp,GS_size_x - mov eax,ebp - shl eax,2 - sub ebx,eax - - mov edx,GS_size_y - sub esi,ebx -;-------------------------------------- -align 4 -.start_y: - add esi,ebx - mov ecx,ebp -;-------------------------------------- -align 4 -.start_x: - mov eax,[gs:esi] - mov [edi],eax - add esi,4 - add edi,3 - - dec ecx - jnz .start_x - - dec edx - jnz .start_y - - pop edi - ret -;----------------------------------------------------------------------------- -align 4 -get_area_with_GS_24: - mcall 61,3 - mov ebx,eax - - mov esi,GS_start_y - imul esi,eax - - mov eax,GS_start_x - lea eax,[eax*3] - add esi,eax - - mov ebp,GS_size_x - mov eax,ebp - lea eax,[eax*3] - sub ebx,eax - - mov edx,GS_size_y - sub esi,ebx -;-------------------------------------- -align 4 -.start_y: - add esi,ebx - mov ecx,ebp -;-------------------------------------- -align 4 -.start_x: - mov eax,[gs:esi] - mov [edi],eax - add esi,3 - add edi,3 - - dec ecx - jnz .start_x - - dec edx - jnz .start_y - - pop edi - ret -;----------------------------------------------------------------------------- -align 4 -get_area_with_GS_16: - mcall 61,3 - mov ebx,eax - - mov esi,GS_start_y - imul esi,eax - - mov eax,GS_start_x - shl eax,1 - add esi,eax - - mov ebp,GS_size_x - mov eax,ebp - shl eax,1 - sub ebx,eax - - mov edx,GS_size_y - sub esi,ebx -;-------------------------------------- -align 4 -.start_y: - add esi,ebx - mov ecx,ebp -;-------------------------------------- -align 4 -.start_x: - xor eax,eax - mov ax,[gs:esi] - shl eax, 3 - ror eax, 8 - shl ax, 2 - ror eax, 8 - shl al, 3 - rol eax, 16 - mov [edi],eax - add esi,2 - add edi,3 - - dec ecx - jnz .start_x - - dec edx - jnz .start_y - - pop edi - ret -;----------------------------------------------------------------------------- -align 4 -testDrawVertLine: - mcall 38,<300,300>,<30,380>,1090207Fh - ret -;--------------------------------------------------------------------- -align 4 -testDrawHorzLine: - mcall 38,<30,300>,<380,380>,1090207Fh - ret -;--------------------------------------------------------------------- -align 4 -testDrawFreeLine: - mcall 38,<30,300>,<380,30>,1090207Fh - ret -;--------------------------------------------------------------------- -align 4 -testDrawText1: - mcall 4,<12,300>,0x0000AA66,aTestText,34 - ret -;--------------------------------------------------------------------- -align 4 -testDrawText1m: - mov eax,[text_scren_buffer] - mov [eax],dword 6*34 - mov [eax+4],dword 9 - mcall 4,<0,0>,0x0800AA66,aTestText,34,[text_scren_buffer] - xor ebp,ebp - mov ebx,[text_scren_buffer] - add ebx,8 - mcall 65,,<6*34,9>,<18,309>,32 - ret -;--------------------------------------------------------------------- -align 4 -testDrawText2: - mcall 4,<27,315>,0x10E7B850,aTestText,34 - ret -;--------------------------------------------------------------------- -align 4 -testDrawText2m: - mov eax,[text_scren_buffer2] - mov [eax],dword 6*38 - mov [eax+4],dword 9 - mcall 4,<0,0>,0x18E7B850,aTestText,34,[text_scren_buffer2] - xor ebp,ebp - mov ebx,[text_scren_buffer2] - add ebx,8 - mcall 65,,<6*38,9>,<33,324>,32 - ret -;--------------------------------------------------------------------- -align 4 -testDrawNumber: - mcall 47,0x80000,12345678,<42,333>,0x0E0B27B - ret -;--------------------------------------------------------------------- -align 4 -testDrawPixel: - mcall 1,100,100,0FFFFFFh - ret -;--------------------------------------------------------------------- -DrawBars: - mov edi,results_table - mov ebx,30+7 -.next_result: - cmp dword[edi+TEST_REC_SIZE-4],0 - je .exit - - push ebx - movzx ecx,bx - add ecx,-2 - shl ecx,16 - mov cx,LINE_HEIGHT - mov ebx,0*65536+LINE_DESCRIPTION_CHARS*8+5 - xor edx,edx - mcall 13 - pop ebx - - and ebx,0x0000FFFF - or ebx,5*65536 - mov edx,[edi+TEST_REC_SIZE-4] - mcall 4,,0x9000CCCC - - push '=' 0x00FFFF00 0x00FFFF7F 0x00FFFF7F - mov eax,[edi+0] - cmp eax,[edi+4] - je @f - jb .lp1 - mov dword[esp+0],0x007FFF7F - mov dword[esp+4],0x00FF7F7F - mov dword[esp+8],0x0000FF00 - mov byte[esp+12],'>' -.lp1: - ja @f - mov dword[esp+0],0x00FF7F7F - mov dword[esp+4],0x007FFF7F - mov dword[esp+8],0x00FF0000 - mov byte[esp+12],'<' -@@: - pop ecx - call int2str - add ebx,(LINE_DESCRIPTION_CHARS*8-8*8*2-20)*65536 ; 196 - add ecx,0x10000000 ;big font - mcall 4,,,textarea,8 - - pop ecx - mov eax,[edi+4] - call int2str - add ebx,(6*8+26)*65536 - add ecx,0x10000000 ;big font - mcall 4 - - ;pop ecx - ;add ebx,(-15)*65536 - ;mov edx,esp - ;mov esi,1 - ;add ecx,0x10000000 ;big font - ;mcall - - - ; draw difference - pop ecx - add ecx,0x10000000 ;big font - - pusha - mov esi,ecx - mov eax,[edi+0] - mov ecx,[edi+4] - cmp ecx,0 - je .difference_end ; no div by zero - imul eax,100 - xor edx,edx - div ecx - mov ecx, eax - sub ecx,100 - mov [sign],'+' - cmp ecx,0 - jge @f ; no need to invert positive rumber - neg ecx - mov [sign],'-' - @@: - cmp ecx,1 ; do not show <=1% results - jle .difference_end - cmp ecx,100 ; do not show >=100% results - je .difference_end - - push ecx esi - add ebx,(10*8)*65536 - mov ecx,esi - mov edx,sign - mov esi,1 - mcall 4 - pop esi ecx - - add ebx,(1*8)*65536 - mov edx,ebx - mcall 47, 10000000000001000000000000000000b - - .difference_end: - popa - - add esp,4 - - add edi,TEST_REC_SIZE - add bx,LINE_HEIGHT - jmp .next_result -.exit: - - - mov ebx, 0*65536+LINE_DESCRIPTION_CHARS*8+5 - mov ecx, (TESTS_NUM*LINE_HEIGHT+15+27)*65536+LINE_HEIGHT*2 - xor edx, edx - mcall 13 - - mov ebx, 5*65536+(TESTS_NUM*LINE_HEIGHT+15+27) - mcall 4,,0x9000CCCC,aLeft - - add ebx, (8*10)*65536 - mcall ,,0x90FFFF00,comment_string_1 - - mov ebx, 5*65536+(TESTS_NUM*LINE_HEIGHT+15+27+LINE_HEIGHT) - mcall ,,0x9000CCCC,aRight - - add ebx, (8*10)*65536 - mcall ,,0x90FFFF00,comment_string_2 - ret -;--------------------------------------------------------------------- -int2str: - push eax ecx edx edi - mov edi,textarea+7 - mov dword[textarea+0],' ' - mov dword[textarea+4],' ' - mov ecx,10 -@@: - xor edx,edx - div ecx - add dl,'0' - mov [edi],dl - dec edi - or eax,eax - jnz @b - pop edi edx ecx eax - ret -;--------------------------------------------------------------------- -thread_comment: - or dword [wFlags],1 - mcall 40,0x80000027 - mov esi,comment_string_1 - cld -@@: - lodsb - test al,al - jne @r - sub esi,comment_string_1 - mov eax,esi - dec eax - mov edi, edit1 - mov [edi+48], eax ;ed_size - mov [edi+52], eax ;ed_pos - - mov esi,comment_string_2 - cld -@@: - lodsb - test al,al - jne @r - sub esi,comment_string_2 - mov eax,esi - dec eax - mov edi, edit2 - mov [edi+48], eax ;ed_size - mov [edi+52], eax ;ed_pos - - ;--------------------------------------------------------------------- -.red: - call .draw_window -.still: - mcall 10 ; wait here for event - cmp eax,1 ; redraw request ? - je .red - cmp eax,2 ; key in buffer ? - je .key - cmp eax,3 ; button in buffer ? - je .button - - push dword edit1 - call [edit_box_mouse] - push dword edit2 - call [edit_box_mouse] - jmp .still -;--------------------------------------------------------------------- -.key: ; key - mcall 2 - cmp ah,13 - je .close ;.close_with_open_file - cmp ah,27 - je .close - - push dword edit1 - call [edit_box_key] - push dword edit2 - call [edit_box_key] - jmp .still -;--------------------------------------------------------------------- -.button: ; button - mcall 17 - cmp ah,1 ; button id=1 ? - jne .still -.close: - xor dword [wFlags],1 - mcall -1 -;--------------------------------------------------------------------- -.draw_window: - mcall 12,1 - xor eax,eax - xor esi,esi - mcall ,<110,300>,<120,120>,0x34C0C0C0,,aCommentT ; 0x34780078 - push dword edit1 - call [edit_box_draw] - push dword edit2 - call [edit_box_draw] - mcall 12,2 - ret -;--------------------------------------------------------------------- -locLoadFile: - mov [stFileInfoBlock], 0 - or dword [wFlags],1 - mcall 70,stFileInfoBlock - mov esi,mgb_data - mov edi,results_table+4 - cld -@@: - cmp dword[edi+TEST_REC_SIZE-8],0 - je @f - movsd - add edi,TEST_REC_SIZE-4 - jmp @b -@@: - mov edi,comment_string_2 - mov ecx,44 - rep movsb - ret -;--------------------------------------------------------------------- -locSaveFile: - mov [stFileInfoBlock], 2 - or dword [wFlags],1 - mov esi,results_table ;+4 to save Right Bar - mov edi,mgb_data - cld -@@: - cmp dword[esi+TEST_REC_SIZE-8],0 - je @f - movsd - add esi,TEST_REC_SIZE-4 - jmp @b -@@: - mov esi,comment_string_2 - mov ecx,44 - rep movsb - mcall 70,stFileInfoBlock - ret -;--------------------------------------------------------------------- -align 4 -stFileInfoBlock dd 0,0,0 -dwDataSize dd TESTS_NUM*4+44 ;1 - dd mgb_data - db 0 - dd fname_buf -;--------------------------------------------------------------------- -wFlags dd 0 -;--------------------------------------------------------------------- -align 4 -results_table dd \ - ?,?,testDrawWindow,aDrawingWindow,\ - ?,?,testDrawBar,aDrawingBar,\ - ?,?,testGetScreen_f36,aGetScreenF36,\ - ?,?,testGetScreen_GS,aGetScreen_GS,\ - ?,?,testDrawPicture,aDrawingPicture,\ - ?,?,testDrawPicture_f73,aDrawingPictF73,\ - ?,?,testDrawVertLine,aDrawingVLine,\ - ?,?,testDrawHorzLine,aDrawingHLine,\ - ?,?,testDrawFreeLine,aDrawingFLine,\ - ?,?,testDrawText1,aDrawingText1,\ - ?,?,testDrawText1m,aDrawingText1m,\ - ?,?,testDrawText2,aDrawingText2,\ - ?,?,testDrawText2m,aDrawingText2m,\ - ?,?,testDrawNumber,aDrawingNumber,\ - ?,?,testDrawPixel,aDrawingPixel,\ - 0,0,0,0 -;--------------------------------------------------------------------- -LINE_HEIGHT = 17 -TEST_REC_SIZE = 16 -LINE_DESCRIPTION_CHARS = 58 -TESTS_NUM = ($ - results_table) / TEST_REC_SIZE - 1 -;--------------------------------------------------------------------- -if lang eq it_IT - aDrawingWindow db 'Window Of Type #3, 325x400 px',0 - aDrawingBar db 'Filled Rectangle, 100x250 px',0 - aDrawingPicture db 'Picture, 90x123, px',0 - aDrawingPictF73 db 'Picture for Blitter, 90x123, px',0 - aGetScreenF36 db 'Get a piece of screen f.36, 90x123, px',0 - aGetScreen_GS db 'Get a piece of screen GS, 90x123, px',0 - aDrawingVLine db 'Linea verticale, 350 px',0 - aDrawingHLine db 'Linea orizzontale, 270 px',0 - aDrawingFLine db 'Free-angled Line, 350 px',0 - aDrawingText1 db 'Fixed-width Text, 34 chars',0 - aDrawingText1m db 'Fixed-width Text(m), 34 chars',0 - aDrawingText2 db 'Proportional Text, 34 chars',0 - aDrawingText2m db 'Proportional Text(m), 34 chars',0 - aDrawingNumber db 'Decimal Number, 8 digits',0 - aDrawingPixel db 'Singolo pixel',0 - - aTestText db 'This is a 34-charachters test text' - aButtonsText db 'Test Commenti Apri Salva Move >',0 - aCaption db 'Kolibri Graphical Benchmark 0.9',0 - - aLeft db 'Sinistra:',0 - aRight db 'Destra :',0 - - aComment1 db 'Attuale test',0 - aComment2 db 'previous test',0 - aCommentT db 'Commenti',0 -else if lang eq ru_RU - aDrawingWindow db 'Системное окно со скином, 325x400 px',0 - aDrawingBar db 'Закрашенный прямоугольник, 100x250 px',0 - aDrawingPicture db 'Картинка, 90x123, px',0 - aDrawingPictF73 db 'Картинка для блиттера, 90x123, px',0 - aGetScreenF36 db 'Чтение экрана из видеопамяти, 90x123, px',0 - aGetScreen_GS db 'Чтение экрана из видеокарты, 90x123, px',0 - aDrawingVLine db 'Больший катет, 350 px',0 - aDrawingHLine db 'Меньший катет, 270 px',0 - aDrawingFLine db 'Гипотенуза, 350 px',0 - aDrawingText1 db 'Системный текст маленький, 34 знака',0 - aDrawingText1m db 'Системный текст маленький (буф), 34 знака',0 - aDrawingText2 db 'Системный текст большой, 34 знака',0 - aDrawingText2m db 'Системный текст большой (буф), 34 знака',0 - aDrawingNumber db 'Десятичное число, 8 цифр',0 - aDrawingPixel db 'Одиночный пиксель',0 - - aTestText db 'This is a 34-charachters test text' - aButtonsText db 'Тест Названия Из файла В файл Вправо >',0 - aCaption db 'Графический бенчмарк для Колибри v0.9',0 - - aLeft db 'Слева:',0 - aRight db 'Справа:',0 - - aComment1 db 'этот тест',0 - aComment2 db 'предыдущий тест',0 - aCommentT db 'Редактировать комментарии',0 -else - aDrawingWindow db 'Window Of Type #3, 325x400 px',0 - aDrawingBar db 'Filled Rectangle, 100x250 px',0 - aDrawingPicture db 'Picture, 90x123, px',0 - aDrawingPictF73 db 'Picture for Blitter, 90x123, px',0 - aGetScreenF36 db 'Get a piece of screen f.36, 90x123, px',0 - aGetScreen_GS db 'Get a piece of screen GS, 90x123, px',0 - aDrawingVLine db 'Vertical Line, 350 px',0 - aDrawingHLine db 'Horizontal Line, 270 px',0 - aDrawingFLine db 'Free-angled Line, 350 px',0 - aDrawingText1 db 'Fixed-width Text, 34 chars',0 - aDrawingText1m db 'Fixed-width Text(mem), 34 chars',0 - aDrawingText2 db 'Proportional Text, 34 chars',0 - aDrawingText2m db 'Proportional Text(mem), 34 chars',0 - aDrawingNumber db 'Decimal Number, 8 digits',0 - aDrawingPixel db 'Single Pixel',0 - - aTestText db 'This is a 34-charachters test text' - aButtonsText db 'Test Comments Open Save Move >',0 - aCaption db 'Kolibri Graphical Benchmark 0.9',0 - - aLeft db 'Left :',0 - aRight db 'Right :',0 - - aComment1 db 'current test',0 - aComment2 db 'previous test',0 - aCommentT db 'Edit comments',0 -end if -;--------------------------------------------------------------------- -system_dir_Boxlib db '/sys/lib/box_lib.obj',0 -system_dir_ProcLib db '/sys/lib/proc_lib.obj',0 -;--------------------------------------------------------------------- -head_f_i: -if lang eq it_IT - head_f_l db 'Errore Sistema',0 -else - head_f_l db 'System error',0 -end if - -err_message_found_lib1 db 'box_lib.obj - Not found!',0 -err_message_found_lib2 db 'proc_lib.obj - Not found!',0 - -err_message_import1 db 'box_lib.obj - Wrong import!',0 -err_message_import2 db 'proc_lib.obj - Wrong import!',0 -;--------------------------------------------------------------------- -align 4 -l_libs_start: - -library01 l_libs system_dir_Boxlib+9, cur_dir_path, library_path, system_dir_Boxlib, \ -err_message_found_lib1, head_f_l, Box_lib_import, err_message_import1, head_f_i - -library02 l_libs system_dir_ProcLib+9, cur_dir_path, library_path, system_dir_ProcLib, \ -err_message_found_lib2, head_f_l, ProcLib_import, err_message_import2, head_f_i - -end_l_libs: -;--------------------------------------------------------------------- -align 4 -OpenDialog_data: -.type dd 1 ; Save -.procinfo dd procinfo ;+4 -.com_area_name dd communication_area_name ;+8 -.com_area dd 0 ;+12 -.opendir_pach dd temp_dir_pach ;+16 -.dir_default_pach dd communication_area_default_pach ;+20 -.start_path dd open_dialog_path ;+24 -.draw_window dd draw_window ;+28 -.status dd 0 ;+32 -.openfile_pach dd fname_buf ;+36 -.filename_area dd filename_area ;+40 -.filter_area dd Filter -.x: -.x_size dw 420 ;+48 ; Window X size -.x_start dw 10 ;+50 ; Window X position -.y: -.y_size dw 320 ;+52 ; Window y size -.y_start dw 10 ;+54 ; Window Y position - -communication_area_name: - db 'FFFFFFFF_open_dialog',0 -open_dialog_path: -if __nightbuild eq yes - db '/sys/MANAGERS/opendial',0 -else - db '/sys/File Managers/opendial',0 -end if -communication_area_default_pach: - db '/sys/',0 - -Filter: -dd Filter.end - Filter -.1: -db 'MGB',0 -.end: -db 0 - -sign db ?,0 - -start_temp_file_name: db 'results.mgb',0 - -path4 db '/sys/results.mgb',0 -;--------------------------------------------------------------------- -align 4 -params_f73: -; destination -.offset_X_dest dd 0 ; +0 -.offset_Y_dest dd 0 ; +4 -.width_dest dd 90 ; +8 -.height_dest dd 123 ; +12 -; source -.offset_X_src dd 0 ; +16 -.offset_Y_src dd 0 ; +20 -.width_src dd 90 ; +24 -.height_src dd 123 ; +28 -; other -.pointer dd .data; 90*4 ; +32 -.row_size dd 90*4 ; +36 -;--------------------------------------------------------------------- -align 4 -ProcLib_import: -OpenDialog_Init dd aOpenDialog_Init -OpenDialog_Start dd aOpenDialog_Start -;OpenDialog__Version dd aOpenDialog_Version - dd 0,0 -aOpenDialog_Init db 'OpenDialog_init',0 -aOpenDialog_Start db 'OpenDialog_start',0 -;aOpenDialog_Version db 'Version_OpenDialog',0 -;--------------------------------------------------------------------- -align 4 -Box_lib_import: -;init_lib dd a_init -;version_lib dd a_version - - -edit_box_draw dd aEdit_box_draw -edit_box_key dd aEdit_box_key -edit_box_mouse dd aEdit_box_mouse -;version_ed dd aVersion_ed - -;check_box_draw dd aCheck_box_draw -;check_box_mouse dd aCheck_box_mouse -;version_ch dd aVersion_ch - -;option_box_draw dd aOption_box_draw -;option_box_mouse dd aOption_box_mouse -;version_op dd aVersion_op - -;scrollbar_ver_draw dd aScrollbar_ver_draw -;scrollbar_ver_mouse dd aScrollbar_ver_mouse -;scrollbar_hor_draw dd aScrollbar_hor_draw -;scrollbar_hor_mouse dd aScrollbar_hor_mouse -;version_scrollbar dd aVersion_scrollbar - -;dinamic_button_draw dd aDbutton_draw -;dinamic_button_mouse dd aDbutton_mouse -;version_dbutton dd aVersion_dbutton - -;menu_bar_draw dd aMenu_bar_draw -;menu_bar_mouse dd aMenu_bar_mouse -;menu_bar_activate dd aMenu_bar_activate -;version_menu_bar dd aVersion_menu_bar - -;FileBrowser_draw dd aFileBrowser_draw -;FileBrowser_mouse dd aFileBrowser_mouse -;FileBrowser_key dd aFileBrowser_key -;Version_FileBrowser dd aVersion_FileBrowser - -;PathShow_prepare dd sz_PathShow_prepare -;PathShow_draw dd sz_PathShow_draw -;Version_path_show dd szVersion_path_show - dd 0,0 - -;a_init db 'lib_init',0 -;a_version db 'version',0 - -aEdit_box_draw db 'edit_box_draw',0 -aEdit_box_key db 'edit_box_key',0 -aEdit_box_mouse db 'edit_box_mouse',0 -;aVersion_ed db 'version_ed',0 - -;aCheck_box_draw db 'check_box_draw',0 -;aCheck_box_mouse db 'check_box_mouse',0 -;aVersion_ch db 'version_ch',0 - -;aOption_box_draw db 'option_box_draw',0 -;aOption_box_mouse db 'option_box_mouse',0 -;aVersion_op db 'version_op',0 - -;aScrollbar_ver_draw db 'scrollbar_v_draw',0 -;aScrollbar_ver_mouse db 'scrollbar_v_mouse',0 -;aScrollbar_hor_draw db 'scrollbar_h_draw',0 -;aScrollbar_hor_mouse db 'scrollbar_h_mouse',0 -;aVersion_scrollbar db 'version_scrollbar',0 - -;aDbutton_draw db 'dbutton_draw',0 -;aDbutton_mouse db 'dbutton_mouse',0 -;aVersion_dbutton db 'version_dbutton',0 - -;aMenu_bar_draw db 'menu_bar_draw',0 -;aMenu_bar_mouse db 'menu_bar_mouse',0 -;aMenu_bar_activate db 'menu_bar_activate',0 -;aVersion_menu_bar db 'version_menu_bar',0 - -;aFileBrowser_draw db 'FileBrowser_draw',0 -;aFileBrowser_mouse db 'FileBrowser_mouse',0 -;aFileBrowser_key db 'FileBrowser_key',0 -;aVersion_FileBrowser db 'version_FileBrowser',0 - -;sz_PathShow_prepare db 'PathShow_prepare',0 -;sz_PathShow_draw db 'PathShow_draw',0 -;szVersion_path_show db 'version_PathShow',0 -;--------------------------------------------------------------------- -; for EDITBOX -align 4 -editboxes: -edit1 edit_box 260,12,15,0xffffff,0xbbddff,0xFF00FF,0x7F7F7F,\ - 0x90000000,43,comment_string_1,0,ed_focus,0 -edit2 edit_box 260,12,50,0xffffff,0xbbddff,0xFF00FF,0x7F7F7F,\ - 0x90000000,43,comment_string_2,0,0,0 -editboxes_end: -;--------------------------------------------------------------------- - -IM_END: -align 4 -area_for_f36 rd 1 -dwTestEndTime rd 1 -dwMainPID rd 1 -;----------------------------------------------------------------------------- -text_scren_buffer rd 1 -text_scren_buffer2 rd 1 -;--------------------------------------------------------------------- -textarea: - rb 8 -;--------------------------------------------------------------------- -comment_string_1: - rb 44 -;--------------------------------------------------------------------- -comment_string_2: - rb 44 -;--------------------------------------------------------------------- -mgb_data: - rb 100 -;--------------------------------------------------------------------- -procinfo: - rb 1024 -;--------------------------------------------------------------------- -cur_dir_path: - rb 4096 -;--------------------------------------------------------------------- -library_path: - rb 4096 -;--------------------------------------------------------------------- -temp_dir_pach: - rb 4096 -;--------------------------------------------------------------------- -fname_buf: - rb 4096 -;--------------------------------------------------------------------- -filename_area: - rb 256 -;--------------------------------------------------------------------- -align 4 - rb 4096 -thread_stack2: -;--------------------------------------------------------------------- -align 4 - rb 4096 -thread_stack1: -;--------------------------------------------------------------------- -align 4 - rb 4096 -stacktop: -params_f73.data rb 123*90*4 -I_END: +; SPDX-License-Identifier: NOASSERTION +; + +; Text encoded with Code Page 866 - Cyrillic + + +;============================================================================= +; Kolibri Graphics Benchmark 0.9 +;-------------------------------------- +; MGB - Menuet Graphics Benchmark 0.3 +; Compile with FASM +; +;============================================================================= +; version: 0.9 +; last update: 15/04/2019 +; written by: Kiril Lipatov aka Leency +; changes: use big fonts, editing two comments, improve UI, show delta % +; Russian translation by Daniel Ovchinnikov +;--------------------------------------------------------------------- +; version: 0.82 +; last update: 03/11/2014 +; written by: Marat Zakiyanov aka Mario79, aka Mario +; changes: fix "benchmark GS selector" for 16bpp (support SVN r.5154) +;--------------------------------------------------------------------- +; version: 0.81 +; last update: 01/05/2014 +; written by: Marat Zakiyanov aka Mario79, aka Mario +; changes: fix "benchmark GS selector" for some display sizes +; (for example, 1366 by horizontal) and code optimization +;--------------------------------------------------------------------- +; version: 0.8 +; last update: 08/07/2013 +; written by: Marat Zakiyanov aka Mario79, aka Mario +; changes: benchmark f4 with memory + f65 +;--------------------------------------------------------------------- +; version: 0.7 +; last update: 05/04/2013 +; written by: Marat Zakiyanov aka Mario79, aka Mario +; changes: benchmark GS selector - read screen area +;--------------------------------------------------------------------- +; version: 0.6 +; last update: 14/03/2013 +; written by: Marat Zakiyanov aka Mario79, aka Mario +; changes: benchmark f36 - read screen area +;--------------------------------------------------------------------- +; version: 0.5 +; last update: 05/03/2013 +; written by: Marat Zakiyanov aka Mario79, aka Mario +; changes: benchmark f73-blitter +;--------------------------------------------------------------------- +; version: 0.4 +; last update: 18/09//2010 +; written by: Marat Zakiyanov aka Mario79, aka Mario +; changes: select path with OpenDialog, +; use of Box_Lib and Proc_Lib, +; support start with path for *.mgb file +; optimization code and size of use memory +;--------------------------------------------------------------------- +; Original author and copyrights holder: +; Mikhail Lisovin a.k.a. Mihasik +; lisovin@26.ru +; +; Disassembled with IDA 5.0.0.879: +; http://www.datarescue.com/ +; With use of 'ida.int' and 'kloader.ldw': +; Eugene Grechnikov a.k.a. diamond +; diamondz@land.ru +; http://diamondz.land.ru/ +; +; Modified for version 0.3: +; Mike Semenako a.k.a mike.dld +; mike.dld@gmail.com +; http://www.mikedld.com/ +; +;============================================================================= + +org 0x0 +use32 + + db 'MENUET01' + dd 1 + dd start + dd IM_END + dd I_END ;0x200000 + dd stacktop ;0x07FFF0 + dd fname_buf + dd cur_dir_path + +include '../../config.inc' ;for nightbuild +include '../../macros.inc' +include '../../proc32.inc' +;include '../../debug.inc' +include '../../develop/libraries/box_lib/trunk/box_lib.mac' +include '../../develop/libraries/box_lib/load_lib.mac' +include 'lang.inc' ; Language support for locales: it_IT, ru_RU (CP866), en_US + @use_library +;--------------------------------------------------------------------- +start: + mcall 68,11 + + mcall 68,12,8+9*6*38*4 ; 7352 + mov [text_scren_buffer],eax + + mcall 68,12,8+9*6*38*4 ; 8216 + mov [text_scren_buffer2],eax + +load_libraries l_libs_start,end_l_libs + + cmp eax,-1 + jz close +;--------------------------------------------------------------------- + mov edi,filename_area + mov esi,start_temp_file_name + call copy_str_1 + + mov edi,comment_string_1 + mov esi,aComment1 + call copy_str_1 + + mov edi,comment_string_2 + mov esi,aComment2 + call copy_str_1 + + mov edi,fname_buf + cmp [edi],byte 0 + jne @f + mov esi,path4 + call copy_str_1 + jmp .OpenDialog +@@: + call locLoadFile + xor dword [wFlags],1 +.OpenDialog: +;OpenDialog initialisation + push dword OpenDialog_data + call [OpenDialog_Init] +;--------------------------------------------------------------------- + mcall 40,0x80000027 +red: + call draw_window +still: + mcall 10 + cmp eax,1 + jz red + cmp eax,2 + jz key + cmp eax,3 + jz button + jmp still +;--------------------------------------------------------------------- +copy_str_1: + xor eax,eax + cld +@@: + lodsb + stosb + test eax,eax + jnz @b + ret +;--------------------------------------------------------------------- +key: + mcall 2 + cmp ah,'t' + jz ActionTest + cmp ah,'c' + jz ActionComment + cmp ah,'m' + jz ActionPatternMove + cmp ah,'o' + jz ActionOpen + cmp ah,'s' + jz ActionSave + jmp still +;--------------------------------------------------------------------- +button: + mcall 17 + cmp ah,1 + jnz NotClose +close: + mcall -1 +NotClose: + cmp ah,2 + jnz locNotTest +ActionTest: + test dword [wFlags],1 + jnz still + mcall 51,1,TestWndProc,thread_stack1 + jmp still +;--------------------------------------------------------------------- +locNotTest: + cmp ah,3 + jnz NotComment +ActionComment: + test dword [wFlags],1 + jnz still + mcall 51,1,thread_comment,thread_stack2 + jmp still +;--------------------------------------------------------------------- +NotComment: + cmp ah,6 + jnz NotPatternCopy +ActionPatternMove: + test dword [wFlags],1 + jnz still + mov esi,results_table + cld +@@: + lodsd + mov [esi],eax + add esi,TEST_REC_SIZE-4 + cmp dword [esi+TEST_REC_SIZE-4],0 + jne @b + mov esi,comment_string_1 + mov edi,comment_string_2 + call copy_str_1 + call DrawBars + jmp still +;--------------------------------------------------------------------- +NotPatternCopy: + cmp ah,4 + jnz NotOpen +ActionOpen: + test dword [wFlags],1 + jnz still + mov [OpenDialog_data.type],0 ; open + call OpenDialog_Start_1 + jne still + call locLoadFile + call DrawBars +.1: + xor dword [wFlags],1 + jmp still +;--------------------------------------------------------------------- +OpenDialog_Start_1: + push dword OpenDialog_data + call [OpenDialog_Start] + cmp [OpenDialog_data.status],1 + ret +;--------------------------------------------------------------------- +NotOpen: + cmp ah,5 + jnz still +ActionSave: + test dword [wFlags],1 + jnz still + mov [OpenDialog_data.type],1 ; save + call OpenDialog_Start_1 + jne still + call locSaveFile + jmp ActionOpen.1 +;--------------------------------------------------------------------- +TestWndProc: + mcall 68,12,90*123*3 + mov [area_for_f36],eax + or dword [wFlags],1 + mov esi,results_table+8 +align 4 +.next_test: + xor edi,edi + mcall 26,9 + inc eax + mov ecx,eax + add eax,100 + mov [dwTestEndTime],eax +align 4 +@@: + mcall 26 + cmp eax,ecx + jb @r +align 4 +@@: + push esi edi + call dword [esi] + pop edi esi + inc edi + mcall 26,9 + cmp eax,[dwTestEndTime] + jb @b + mov [esi-8],edi + + add esi,TEST_REC_SIZE + cmp dword [esi], testDrawPicture_f73 + jnz @f + call prepare_f73 +@@: + cmp dword [esi],0 + jnz .next_test + xor dword [wFlags],1 + mcall 68,13,[area_for_f36] + mcall -1 +;--------------------------------------------------------------------- +draw_window: + mcall 12,1 + mcall 48,4 + mov ebx,460*65536+(LINE_DESCRIPTION_CHARS+5)*8+16 + mov ecx,80*65536+TESTS_NUM*(LINE_HEIGHT+2)+15+38 + add cx,ax + xor eax,eax + xor esi,esi + mcall ,,,34000000h,,aCaption + + mov eax,8 + mov ebx,20*65536+84 + mov ecx,4*65536+24 + mov edx,2 + mov esi,0x00007F7F +@@: + mcall + add ebx,96*65536 + inc edx + cmp edx,7 + jb @r + + mov ecx,33 + mov edx,0x00007F7F + mov esi,(LINE_DESCRIPTION_CHARS*8)/2+20 + call drawSeparator + + mcall 4,<46,9>,0x90DDEEFF,aButtonsText + call DrawBars + + mov ecx,TESTS_NUM*LINE_HEIGHT+15+23 + mov edx,0x00007F7F + mov esi,(LINE_DESCRIPTION_CHARS*8)/2+20 + call drawSeparator + mcall 12,2 + ret +;--------------------------------------------------------------------- +drawSeparator: + mov eax,1 + mov ebx,3 +@@: + mcall + add ebx,2 + dec esi + jnz @b + ret +;--------------------------------------------------------------------- +align 4 +testDrawWindow: + xor eax,eax + mcall ,640145h,4F0190h,3000000h + ret +;--------------------------------------------------------------------- +align 4 +testDrawBar: + mcall 13,0A0064h,1E00FAh,6A73D0h + ret +;--------------------------------------------------------------------- +align 4 +testDrawPicture: +; xor ebx,ebx + mcall 7,[area_for_f36],<90,123>,<15,33> + ret +;--------------------------------------------------------------------- +prepare_f73: + mov ecx, 90*123 + mov eax, params_f73.data + mov ebx, [area_for_f36] +@@: + mov edx, [ebx] + and edx, 0xFFFFFF + mov [eax], edx + add ebx, 3 + add eax, 4 + dec ecx + jnz @b + ret +align 4 +testDrawPicture_f73: + xor ebx,ebx + mcall 73,,params_f73 + ret +;--------------------------------------------------------------------- +align 4 +testGetScreen_f36: + xor ebx,ebx + mcall 36,[area_for_f36],<90,123>,<15,33> + ret +;--------------------------------------------------------------------- +GS_start_x = 15 +GS_start_y = 33 +GS_size_x = 90 +GS_size_y = 123 +;----------------------------------------------------------------------------- +align 4 +testGetScreen_GS: + push edi + mov edi,[area_for_f36] + + mcall 61,2 + cmp eax,24 + je get_area_with_GS_24 + + cmp eax,16 + je get_area_with_GS_16 +;----------------------------------------------------------------------------- +align 4 +get_area_with_GS_32: + mcall 61,3 + mov ebx,eax + + mov esi,GS_start_y + imul esi,eax + + mov eax,GS_start_x + shl eax,2 + add esi,eax + + mov ebp,GS_size_x + mov eax,ebp + shl eax,2 + sub ebx,eax + + mov edx,GS_size_y + sub esi,ebx +;-------------------------------------- +align 4 +.start_y: + add esi,ebx + mov ecx,ebp +;-------------------------------------- +align 4 +.start_x: + mov eax,[gs:esi] + mov [edi],eax + add esi,4 + add edi,3 + + dec ecx + jnz .start_x + + dec edx + jnz .start_y + + pop edi + ret +;----------------------------------------------------------------------------- +align 4 +get_area_with_GS_24: + mcall 61,3 + mov ebx,eax + + mov esi,GS_start_y + imul esi,eax + + mov eax,GS_start_x + lea eax,[eax*3] + add esi,eax + + mov ebp,GS_size_x + mov eax,ebp + lea eax,[eax*3] + sub ebx,eax + + mov edx,GS_size_y + sub esi,ebx +;-------------------------------------- +align 4 +.start_y: + add esi,ebx + mov ecx,ebp +;-------------------------------------- +align 4 +.start_x: + mov eax,[gs:esi] + mov [edi],eax + add esi,3 + add edi,3 + + dec ecx + jnz .start_x + + dec edx + jnz .start_y + + pop edi + ret +;----------------------------------------------------------------------------- +align 4 +get_area_with_GS_16: + mcall 61,3 + mov ebx,eax + + mov esi,GS_start_y + imul esi,eax + + mov eax,GS_start_x + shl eax,1 + add esi,eax + + mov ebp,GS_size_x + mov eax,ebp + shl eax,1 + sub ebx,eax + + mov edx,GS_size_y + sub esi,ebx +;-------------------------------------- +align 4 +.start_y: + add esi,ebx + mov ecx,ebp +;-------------------------------------- +align 4 +.start_x: + xor eax,eax + mov ax,[gs:esi] + shl eax, 3 + ror eax, 8 + shl ax, 2 + ror eax, 8 + shl al, 3 + rol eax, 16 + mov [edi],eax + add esi,2 + add edi,3 + + dec ecx + jnz .start_x + + dec edx + jnz .start_y + + pop edi + ret +;----------------------------------------------------------------------------- +align 4 +testDrawVertLine: + mcall 38,<300,300>,<30,380>,1090207Fh + ret +;--------------------------------------------------------------------- +align 4 +testDrawHorzLine: + mcall 38,<30,300>,<380,380>,1090207Fh + ret +;--------------------------------------------------------------------- +align 4 +testDrawFreeLine: + mcall 38,<30,300>,<380,30>,1090207Fh + ret +;--------------------------------------------------------------------- +align 4 +testDrawText1: + mcall 4,<12,300>,0x0000AA66,aTestText,34 + ret +;--------------------------------------------------------------------- +align 4 +testDrawText1m: + mov eax,[text_scren_buffer] + mov [eax],dword 6*34 + mov [eax+4],dword 9 + mcall 4,<0,0>,0x0800AA66,aTestText,34,[text_scren_buffer] + xor ebp,ebp + mov ebx,[text_scren_buffer] + add ebx,8 + mcall 65,,<6*34,9>,<18,309>,32 + ret +;--------------------------------------------------------------------- +align 4 +testDrawText2: + mcall 4,<27,315>,0x10E7B850,aTestText,34 + ret +;--------------------------------------------------------------------- +align 4 +testDrawText2m: + mov eax,[text_scren_buffer2] + mov [eax],dword 6*38 + mov [eax+4],dword 9 + mcall 4,<0,0>,0x18E7B850,aTestText,34,[text_scren_buffer2] + xor ebp,ebp + mov ebx,[text_scren_buffer2] + add ebx,8 + mcall 65,,<6*38,9>,<33,324>,32 + ret +;--------------------------------------------------------------------- +align 4 +testDrawNumber: + mcall 47,0x80000,12345678,<42,333>,0x0E0B27B + ret +;--------------------------------------------------------------------- +align 4 +testDrawPixel: + mcall 1,100,100,0FFFFFFh + ret +;--------------------------------------------------------------------- +DrawBars: + mov edi,results_table + mov ebx,30+7 +.next_result: + cmp dword[edi+TEST_REC_SIZE-4],0 + je .exit + + push ebx + movzx ecx,bx + add ecx,-2 + shl ecx,16 + mov cx,LINE_HEIGHT + mov ebx,0*65536+LINE_DESCRIPTION_CHARS*8+5 + xor edx,edx + mcall 13 + pop ebx + + and ebx,0x0000FFFF + or ebx,5*65536 + mov edx,[edi+TEST_REC_SIZE-4] + mcall 4,,0x9000CCCC + + push '=' 0x00FFFF00 0x00FFFF7F 0x00FFFF7F + mov eax,[edi+0] + cmp eax,[edi+4] + je @f + jb .lp1 + mov dword[esp+0],0x007FFF7F + mov dword[esp+4],0x00FF7F7F + mov dword[esp+8],0x0000FF00 + mov byte[esp+12],'>' +.lp1: + ja @f + mov dword[esp+0],0x00FF7F7F + mov dword[esp+4],0x007FFF7F + mov dword[esp+8],0x00FF0000 + mov byte[esp+12],'<' +@@: + pop ecx + call int2str + add ebx,(LINE_DESCRIPTION_CHARS*8-8*8*2-20)*65536 ; 196 + add ecx,0x10000000 ;big font + mcall 4,,,textarea,8 + + pop ecx + mov eax,[edi+4] + call int2str + add ebx,(6*8+26)*65536 + add ecx,0x10000000 ;big font + mcall 4 + + ;pop ecx + ;add ebx,(-15)*65536 + ;mov edx,esp + ;mov esi,1 + ;add ecx,0x10000000 ;big font + ;mcall + + + ; draw difference + pop ecx + add ecx,0x10000000 ;big font + + pusha + mov esi,ecx + mov eax,[edi+0] + mov ecx,[edi+4] + cmp ecx,0 + je .difference_end ; no div by zero + imul eax,100 + xor edx,edx + div ecx + mov ecx, eax + sub ecx,100 + mov [sign],'+' + cmp ecx,0 + jge @f ; no need to invert positive rumber + neg ecx + mov [sign],'-' + @@: + cmp ecx,1 ; do not show <=1% results + jle .difference_end + cmp ecx,100 ; do not show >=100% results + je .difference_end + + push ecx esi + add ebx,(10*8)*65536 + mov ecx,esi + mov edx,sign + mov esi,1 + mcall 4 + pop esi ecx + + add ebx,(1*8)*65536 + mov edx,ebx + mcall 47, 10000000000001000000000000000000b + + .difference_end: + popa + + add esp,4 + + add edi,TEST_REC_SIZE + add bx,LINE_HEIGHT + jmp .next_result +.exit: + + + mov ebx, 0*65536+LINE_DESCRIPTION_CHARS*8+5 + mov ecx, (TESTS_NUM*LINE_HEIGHT+15+27)*65536+LINE_HEIGHT*2 + xor edx, edx + mcall 13 + + mov ebx, 5*65536+(TESTS_NUM*LINE_HEIGHT+15+27) + mcall 4,,0x9000CCCC,aLeft + + add ebx, (8*10)*65536 + mcall ,,0x90FFFF00,comment_string_1 + + mov ebx, 5*65536+(TESTS_NUM*LINE_HEIGHT+15+27+LINE_HEIGHT) + mcall ,,0x9000CCCC,aRight + + add ebx, (8*10)*65536 + mcall ,,0x90FFFF00,comment_string_2 + ret +;--------------------------------------------------------------------- +int2str: + push eax ecx edx edi + mov edi,textarea+7 + mov dword[textarea+0],' ' + mov dword[textarea+4],' ' + mov ecx,10 +@@: + xor edx,edx + div ecx + add dl,'0' + mov [edi],dl + dec edi + or eax,eax + jnz @b + pop edi edx ecx eax + ret +;--------------------------------------------------------------------- +thread_comment: + or dword [wFlags],1 + mcall 40,0x80000027 + mov esi,comment_string_1 + cld +@@: + lodsb + test al,al + jne @r + sub esi,comment_string_1 + mov eax,esi + dec eax + mov edi, edit1 + mov [edi+48], eax ;ed_size + mov [edi+52], eax ;ed_pos + + mov esi,comment_string_2 + cld +@@: + lodsb + test al,al + jne @r + sub esi,comment_string_2 + mov eax,esi + dec eax + mov edi, edit2 + mov [edi+48], eax ;ed_size + mov [edi+52], eax ;ed_pos + + ;--------------------------------------------------------------------- +.red: + call .draw_window +.still: + mcall 10 ; wait here for event + cmp eax,1 ; redraw request ? + je .red + cmp eax,2 ; key in buffer ? + je .key + cmp eax,3 ; button in buffer ? + je .button + + push dword edit1 + call [edit_box_mouse] + push dword edit2 + call [edit_box_mouse] + jmp .still +;--------------------------------------------------------------------- +.key: ; key + mcall 2 + cmp ah,13 + je .close ;.close_with_open_file + cmp ah,27 + je .close + + push dword edit1 + call [edit_box_key] + push dword edit2 + call [edit_box_key] + jmp .still +;--------------------------------------------------------------------- +.button: ; button + mcall 17 + cmp ah,1 ; button id=1 ? + jne .still +.close: + xor dword [wFlags],1 + mcall -1 +;--------------------------------------------------------------------- +.draw_window: + mcall 12,1 + xor eax,eax + xor esi,esi + mcall ,<110,300>,<120,120>,0x34C0C0C0,,aCommentT ; 0x34780078 + push dword edit1 + call [edit_box_draw] + push dword edit2 + call [edit_box_draw] + mcall 12,2 + ret +;--------------------------------------------------------------------- +locLoadFile: + mov [stFileInfoBlock], 0 + or dword [wFlags],1 + mcall 70,stFileInfoBlock + mov esi,mgb_data + mov edi,results_table+4 + cld +@@: + cmp dword[edi+TEST_REC_SIZE-8],0 + je @f + movsd + add edi,TEST_REC_SIZE-4 + jmp @b +@@: + mov edi,comment_string_2 + mov ecx,44 + rep movsb + ret +;--------------------------------------------------------------------- +locSaveFile: + mov [stFileInfoBlock], 2 + or dword [wFlags],1 + mov esi,results_table ;+4 to save Right Bar + mov edi,mgb_data + cld +@@: + cmp dword[esi+TEST_REC_SIZE-8],0 + je @f + movsd + add esi,TEST_REC_SIZE-4 + jmp @b +@@: + mov esi,comment_string_2 + mov ecx,44 + rep movsb + mcall 70,stFileInfoBlock + ret +;--------------------------------------------------------------------- +align 4 +stFileInfoBlock dd 0,0,0 +dwDataSize dd TESTS_NUM*4+44 ;1 + dd mgb_data + db 0 + dd fname_buf +;--------------------------------------------------------------------- +wFlags dd 0 +;--------------------------------------------------------------------- +align 4 +results_table dd \ + ?,?,testDrawWindow,aDrawingWindow,\ + ?,?,testDrawBar,aDrawingBar,\ + ?,?,testGetScreen_f36,aGetScreenF36,\ + ?,?,testGetScreen_GS,aGetScreen_GS,\ + ?,?,testDrawPicture,aDrawingPicture,\ + ?,?,testDrawPicture_f73,aDrawingPictF73,\ + ?,?,testDrawVertLine,aDrawingVLine,\ + ?,?,testDrawHorzLine,aDrawingHLine,\ + ?,?,testDrawFreeLine,aDrawingFLine,\ + ?,?,testDrawText1,aDrawingText1,\ + ?,?,testDrawText1m,aDrawingText1m,\ + ?,?,testDrawText2,aDrawingText2,\ + ?,?,testDrawText2m,aDrawingText2m,\ + ?,?,testDrawNumber,aDrawingNumber,\ + ?,?,testDrawPixel,aDrawingPixel,\ + 0,0,0,0 +;--------------------------------------------------------------------- +LINE_HEIGHT = 17 +TEST_REC_SIZE = 16 +LINE_DESCRIPTION_CHARS = 58 +TESTS_NUM = ($ - results_table) / TEST_REC_SIZE - 1 +;--------------------------------------------------------------------- +if lang eq it_IT + aDrawingWindow db 'Window Of Type #3, 325x400 px',0 + aDrawingBar db 'Filled Rectangle, 100x250 px',0 + aDrawingPicture db 'Picture, 90x123, px',0 + aDrawingPictF73 db 'Picture for Blitter, 90x123, px',0 + aGetScreenF36 db 'Get a piece of screen f.36, 90x123, px',0 + aGetScreen_GS db 'Get a piece of screen GS, 90x123, px',0 + aDrawingVLine db 'Linea verticale, 350 px',0 + aDrawingHLine db 'Linea orizzontale, 270 px',0 + aDrawingFLine db 'Free-angled Line, 350 px',0 + aDrawingText1 db 'Fixed-width Text, 34 chars',0 + aDrawingText1m db 'Fixed-width Text(m), 34 chars',0 + aDrawingText2 db 'Proportional Text, 34 chars',0 + aDrawingText2m db 'Proportional Text(m), 34 chars',0 + aDrawingNumber db 'Decimal Number, 8 digits',0 + aDrawingPixel db 'Singolo pixel',0 + + aTestText db 'This is a 34-charachters test text' + aButtonsText db 'Test Commenti Apri Salva Move >',0 + aCaption db 'Kolibri Graphical Benchmark 0.9',0 + + aLeft db 'Sinistra:',0 + aRight db 'Destra :',0 + + aComment1 db 'Attuale test',0 + aComment2 db 'previous test',0 + aCommentT db 'Commenti',0 +else if lang eq ru_RU + aDrawingWindow db 'Системное окно со скином, 325x400 px',0 + aDrawingBar db 'Закрашенный прямоугольник, 100x250 px',0 + aDrawingPicture db 'Картинка, 90x123, px',0 + aDrawingPictF73 db 'Картинка для блиттера, 90x123, px',0 + aGetScreenF36 db 'Чтение экрана из видеопамяти, 90x123, px',0 + aGetScreen_GS db 'Чтение экрана из видеокарты, 90x123, px',0 + aDrawingVLine db 'Больший катет, 350 px',0 + aDrawingHLine db 'Меньший катет, 270 px',0 + aDrawingFLine db 'Гипотенуза, 350 px',0 + aDrawingText1 db 'Системный текст маленький, 34 знака',0 + aDrawingText1m db 'Системный текст маленький (буф), 34 знака',0 + aDrawingText2 db 'Системный текст большой, 34 знака',0 + aDrawingText2m db 'Системный текст большой (буф), 34 знака',0 + aDrawingNumber db 'Десятичное число, 8 цифр',0 + aDrawingPixel db 'Одиночный пиксель',0 + + aTestText db 'This is a 34-charachters test text' + aButtonsText db 'Тест Названия Из файла В файл Вправо >',0 + aCaption db 'Графический бенчмарк для Колибри v0.9',0 + + aLeft db 'Слева:',0 + aRight db 'Справа:',0 + + aComment1 db 'этот тест',0 + aComment2 db 'предыдущий тест',0 + aCommentT db 'Редактировать комментарии',0 +else + aDrawingWindow db 'Window Of Type #3, 325x400 px',0 + aDrawingBar db 'Filled Rectangle, 100x250 px',0 + aDrawingPicture db 'Picture, 90x123, px',0 + aDrawingPictF73 db 'Picture for Blitter, 90x123, px',0 + aGetScreenF36 db 'Get a piece of screen f.36, 90x123, px',0 + aGetScreen_GS db 'Get a piece of screen GS, 90x123, px',0 + aDrawingVLine db 'Vertical Line, 350 px',0 + aDrawingHLine db 'Horizontal Line, 270 px',0 + aDrawingFLine db 'Free-angled Line, 350 px',0 + aDrawingText1 db 'Fixed-width Text, 34 chars',0 + aDrawingText1m db 'Fixed-width Text(mem), 34 chars',0 + aDrawingText2 db 'Proportional Text, 34 chars',0 + aDrawingText2m db 'Proportional Text(mem), 34 chars',0 + aDrawingNumber db 'Decimal Number, 8 digits',0 + aDrawingPixel db 'Single Pixel',0 + + aTestText db 'This is a 34-charachters test text' + aButtonsText db 'Test Comments Open Save Move >',0 + aCaption db 'Kolibri Graphical Benchmark 0.9',0 + + aLeft db 'Left :',0 + aRight db 'Right :',0 + + aComment1 db 'current test',0 + aComment2 db 'previous test',0 + aCommentT db 'Edit comments',0 +end if +;--------------------------------------------------------------------- +system_dir_Boxlib db '/sys/lib/box_lib.obj',0 +system_dir_ProcLib db '/sys/lib/proc_lib.obj',0 +;--------------------------------------------------------------------- +head_f_i: +if lang eq it_IT + head_f_l db 'Errore Sistema',0 +else + head_f_l db 'System error',0 +end if + +err_message_found_lib1 db 'box_lib.obj - Not found!',0 +err_message_found_lib2 db 'proc_lib.obj - Not found!',0 + +err_message_import1 db 'box_lib.obj - Wrong import!',0 +err_message_import2 db 'proc_lib.obj - Wrong import!',0 +;--------------------------------------------------------------------- +align 4 +l_libs_start: + +library01 l_libs system_dir_Boxlib+9, cur_dir_path, library_path, system_dir_Boxlib, \ +err_message_found_lib1, head_f_l, Box_lib_import, err_message_import1, head_f_i + +library02 l_libs system_dir_ProcLib+9, cur_dir_path, library_path, system_dir_ProcLib, \ +err_message_found_lib2, head_f_l, ProcLib_import, err_message_import2, head_f_i + +end_l_libs: +;--------------------------------------------------------------------- +align 4 +OpenDialog_data: +.type dd 1 ; Save +.procinfo dd procinfo ;+4 +.com_area_name dd communication_area_name ;+8 +.com_area dd 0 ;+12 +.opendir_pach dd temp_dir_pach ;+16 +.dir_default_pach dd communication_area_default_pach ;+20 +.start_path dd open_dialog_path ;+24 +.draw_window dd draw_window ;+28 +.status dd 0 ;+32 +.openfile_pach dd fname_buf ;+36 +.filename_area dd filename_area ;+40 +.filter_area dd Filter +.x: +.x_size dw 420 ;+48 ; Window X size +.x_start dw 10 ;+50 ; Window X position +.y: +.y_size dw 320 ;+52 ; Window y size +.y_start dw 10 ;+54 ; Window Y position + +communication_area_name: + db 'FFFFFFFF_open_dialog',0 +open_dialog_path: +if __nightbuild eq yes + db '/sys/MANAGERS/opendial',0 +else + db '/sys/File Managers/opendial',0 +end if +communication_area_default_pach: + db '/sys/',0 + +Filter: +dd Filter.end - Filter +.1: +db 'MGB',0 +.end: +db 0 + +sign db ?,0 + +start_temp_file_name: db 'results.mgb',0 + +path4 db '/sys/results.mgb',0 +;--------------------------------------------------------------------- +align 4 +params_f73: +; destination +.offset_X_dest dd 0 ; +0 +.offset_Y_dest dd 0 ; +4 +.width_dest dd 90 ; +8 +.height_dest dd 123 ; +12 +; source +.offset_X_src dd 0 ; +16 +.offset_Y_src dd 0 ; +20 +.width_src dd 90 ; +24 +.height_src dd 123 ; +28 +; other +.pointer dd .data; 90*4 ; +32 +.row_size dd 90*4 ; +36 +;--------------------------------------------------------------------- +align 4 +ProcLib_import: +OpenDialog_Init dd aOpenDialog_Init +OpenDialog_Start dd aOpenDialog_Start +;OpenDialog__Version dd aOpenDialog_Version + dd 0,0 +aOpenDialog_Init db 'OpenDialog_init',0 +aOpenDialog_Start db 'OpenDialog_start',0 +;aOpenDialog_Version db 'Version_OpenDialog',0 +;--------------------------------------------------------------------- +align 4 +Box_lib_import: +;init_lib dd a_init +;version_lib dd a_version + + +edit_box_draw dd aEdit_box_draw +edit_box_key dd aEdit_box_key +edit_box_mouse dd aEdit_box_mouse +;version_ed dd aVersion_ed + +;check_box_draw dd aCheck_box_draw +;check_box_mouse dd aCheck_box_mouse +;version_ch dd aVersion_ch + +;option_box_draw dd aOption_box_draw +;option_box_mouse dd aOption_box_mouse +;version_op dd aVersion_op + +;scrollbar_ver_draw dd aScrollbar_ver_draw +;scrollbar_ver_mouse dd aScrollbar_ver_mouse +;scrollbar_hor_draw dd aScrollbar_hor_draw +;scrollbar_hor_mouse dd aScrollbar_hor_mouse +;version_scrollbar dd aVersion_scrollbar + +;dinamic_button_draw dd aDbutton_draw +;dinamic_button_mouse dd aDbutton_mouse +;version_dbutton dd aVersion_dbutton + +;menu_bar_draw dd aMenu_bar_draw +;menu_bar_mouse dd aMenu_bar_mouse +;menu_bar_activate dd aMenu_bar_activate +;version_menu_bar dd aVersion_menu_bar + +;FileBrowser_draw dd aFileBrowser_draw +;FileBrowser_mouse dd aFileBrowser_mouse +;FileBrowser_key dd aFileBrowser_key +;Version_FileBrowser dd aVersion_FileBrowser + +;PathShow_prepare dd sz_PathShow_prepare +;PathShow_draw dd sz_PathShow_draw +;Version_path_show dd szVersion_path_show + dd 0,0 + +;a_init db 'lib_init',0 +;a_version db 'version',0 + +aEdit_box_draw db 'edit_box_draw',0 +aEdit_box_key db 'edit_box_key',0 +aEdit_box_mouse db 'edit_box_mouse',0 +;aVersion_ed db 'version_ed',0 + +;aCheck_box_draw db 'check_box_draw',0 +;aCheck_box_mouse db 'check_box_mouse',0 +;aVersion_ch db 'version_ch',0 + +;aOption_box_draw db 'option_box_draw',0 +;aOption_box_mouse db 'option_box_mouse',0 +;aVersion_op db 'version_op',0 + +;aScrollbar_ver_draw db 'scrollbar_v_draw',0 +;aScrollbar_ver_mouse db 'scrollbar_v_mouse',0 +;aScrollbar_hor_draw db 'scrollbar_h_draw',0 +;aScrollbar_hor_mouse db 'scrollbar_h_mouse',0 +;aVersion_scrollbar db 'version_scrollbar',0 + +;aDbutton_draw db 'dbutton_draw',0 +;aDbutton_mouse db 'dbutton_mouse',0 +;aVersion_dbutton db 'version_dbutton',0 + +;aMenu_bar_draw db 'menu_bar_draw',0 +;aMenu_bar_mouse db 'menu_bar_mouse',0 +;aMenu_bar_activate db 'menu_bar_activate',0 +;aVersion_menu_bar db 'version_menu_bar',0 + +;aFileBrowser_draw db 'FileBrowser_draw',0 +;aFileBrowser_mouse db 'FileBrowser_mouse',0 +;aFileBrowser_key db 'FileBrowser_key',0 +;aVersion_FileBrowser db 'version_FileBrowser',0 + +;sz_PathShow_prepare db 'PathShow_prepare',0 +;sz_PathShow_draw db 'PathShow_draw',0 +;szVersion_path_show db 'version_PathShow',0 +;--------------------------------------------------------------------- +; for EDITBOX +align 4 +editboxes: +edit1 edit_box 260,12,15,0xffffff,0xbbddff,0xFF00FF,0x7F7F7F,\ + 0x90000000,43,comment_string_1,0,ed_focus,0 +edit2 edit_box 260,12,50,0xffffff,0xbbddff,0xFF00FF,0x7F7F7F,\ + 0x90000000,43,comment_string_2,0,0,0 +editboxes_end: +;--------------------------------------------------------------------- + +IM_END: +align 4 +area_for_f36 rd 1 +dwTestEndTime rd 1 +dwMainPID rd 1 +;----------------------------------------------------------------------------- +text_scren_buffer rd 1 +text_scren_buffer2 rd 1 +;--------------------------------------------------------------------- +textarea: + rb 8 +;--------------------------------------------------------------------- +comment_string_1: + rb 44 +;--------------------------------------------------------------------- +comment_string_2: + rb 44 +;--------------------------------------------------------------------- +mgb_data: + rb 100 +;--------------------------------------------------------------------- +procinfo: + rb 1024 +;--------------------------------------------------------------------- +cur_dir_path: + rb 4096 +;--------------------------------------------------------------------- +library_path: + rb 4096 +;--------------------------------------------------------------------- +temp_dir_pach: + rb 4096 +;--------------------------------------------------------------------- +fname_buf: + rb 4096 +;--------------------------------------------------------------------- +filename_area: + rb 256 +;--------------------------------------------------------------------- +align 4 + rb 4096 +thread_stack2: +;--------------------------------------------------------------------- +align 4 + rb 4096 +thread_stack1: +;--------------------------------------------------------------------- +align 4 + rb 4096 +stacktop: +params_f73.data rb 123*90*4 +I_END: diff --git a/programs/testing/pcidev/trunk/PCIDEV.ASM b/programs/testing/pcidev/PCIDEV.ASM similarity index 99% rename from programs/testing/pcidev/trunk/PCIDEV.ASM rename to programs/testing/pcidev/PCIDEV.ASM index fd2402e3a..61afae9ce 100644 --- a/programs/testing/pcidev/trunk/PCIDEV.ASM +++ b/programs/testing/pcidev/PCIDEV.ASM @@ -1,3 +1,6 @@ +; SPDX-License-Identifier: NOASSERTION +; + ;*************************************************************** ; project name: PCI Device Enumeration ; target platform: KolibriOS @@ -29,10 +32,10 @@ dd file_name ; I_Param dd path ; APPLICATION PATH ;----------------------------------------------------------------------------- -include 'lang.inc' ;language support -include '../../../KOSfuncs.inc' -include '../../../macros.inc' -include '../../../load_lib.mac' +include 'lang.inc' ; Language support for locales: it_IT, en_US +include '../../KOSfuncs.inc' +include '../../macros.inc' +include '../../load_lib.mac' ;----------------------------------------------------------------------------- @use_library ; load_lib macro ;----------------------------------------------------------------------------- diff --git a/programs/testing/pcidev/trunk/Tupfile.lua b/programs/testing/pcidev/Tupfile.lua similarity index 79% rename from programs/testing/pcidev/trunk/Tupfile.lua rename to programs/testing/pcidev/Tupfile.lua index 557ac93e0..6c1ca6edb 100644 --- a/programs/testing/pcidev/trunk/Tupfile.lua +++ b/programs/testing/pcidev/Tupfile.lua @@ -1,5 +1,5 @@ if tup.getconfig("NO_FASM") ~= "" then return end -HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../../.." or tup.getconfig("HELPERDIR") +HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../.." or tup.getconfig("HELPERDIR") tup.include(HELPERDIR .. "/use_fasm.lua") add_include(tup.getvariantdir()) diff --git a/programs/testing/pcidev/trunk/build_en.bat b/programs/testing/pcidev/build_en.bat similarity index 100% rename from programs/testing/pcidev/trunk/build_en.bat rename to programs/testing/pcidev/build_en.bat diff --git a/programs/testing/pcidev/trunk/history.txt b/programs/testing/pcidev/history.txt similarity index 100% rename from programs/testing/pcidev/trunk/history.txt rename to programs/testing/pcidev/history.txt diff --git a/programs/testing/pcidev/trunk/makefile b/programs/testing/pcidev/makefile similarity index 100% rename from programs/testing/pcidev/trunk/makefile rename to programs/testing/pcidev/makefile diff --git a/programs/testing/pcidev/trunk/vendors.add b/programs/testing/pcidev/vendors.add similarity index 100% rename from programs/testing/pcidev/trunk/vendors.add rename to programs/testing/pcidev/vendors.add diff --git a/programs/testing/pcidev/trunk/vendors.inc b/programs/testing/pcidev/vendors.inc similarity index 100% rename from programs/testing/pcidev/trunk/vendors.inc rename to programs/testing/pcidev/vendors.inc diff --git a/programs/testing/protection/trunk/Tupfile.lua b/programs/testing/protection/Tupfile.lua similarity index 79% rename from programs/testing/protection/trunk/Tupfile.lua rename to programs/testing/protection/Tupfile.lua index 711b93bb0..d16176e7b 100644 --- a/programs/testing/protection/trunk/Tupfile.lua +++ b/programs/testing/protection/Tupfile.lua @@ -1,5 +1,5 @@ if tup.getconfig("NO_FASM") ~= "" then return end -HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../../.." or tup.getconfig("HELPERDIR") +HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../.." or tup.getconfig("HELPERDIR") tup.include(HELPERDIR .. "/use_fasm.lua") add_include(tup.getvariantdir()) diff --git a/programs/testing/protection/trunk/build_en.bat b/programs/testing/protection/build_en.bat similarity index 100% rename from programs/testing/protection/trunk/build_en.bat rename to programs/testing/protection/build_en.bat diff --git a/programs/testing/protection/trunk/build_ru.bat b/programs/testing/protection/build_ru.bat similarity index 100% rename from programs/testing/protection/trunk/build_ru.bat rename to programs/testing/protection/build_ru.bat diff --git a/programs/testing/protection/trunk/makefile b/programs/testing/protection/makefile similarity index 100% rename from programs/testing/protection/trunk/makefile rename to programs/testing/protection/makefile diff --git a/programs/testing/protection/trunk/test.asm b/programs/testing/protection/test.asm similarity index 96% rename from programs/testing/protection/trunk/test.asm rename to programs/testing/protection/test.asm index c60a20094..de6b2199a 100644 --- a/programs/testing/protection/trunk/test.asm +++ b/programs/testing/protection/test.asm @@ -1,205 +1,210 @@ -;------------------------------------------------------------------------------- -; -; PROTECTION TEST -; -;------------------------------------------------------------------------------- -; last update: 07/03/2014 -; changed by: Marat Zakiyanov aka Mario79, aka Mario -; changes: Optimisations and code refactoring. -; Reducing the consumption of RAM, 4 KB instead of 64 KB. -; Translation into Russian. -;--------------------------------------------------------------------- -use32 - org 0x0 - - db 'MENUET01' ; 8 byte id - dd 0x01 ; header version - dd START ; start of code - dd I_END ; size of image - dd IM_END ; memory for app - dd stack_top ; esp - dd 0x0 ; I_Param - dd 0x0 ; I_Icon -;------------------------------------------------------------------------------- -include '../../../macros.inc' -include 'lang.inc' -;------------------------------------------------------------------------------- -START: ; start of execution -red: ; redraw - call draw_window ; at first, draw the window -;------------------------------------------------------------------------------- -still: - mcall 10 ; wait here for event - cmp eax,1 ; redraw request ? - jz red - - cmp eax,3 ; button in buffer ? - jz button - - cmp eax,2 ; key in buffer ? - jnz still -;------------------------------------------------------------------------------- -key: - mcall 2 ; just read it and ignore - jmp still -;------------------------------------------------------------------------------- -button: - mcall 17 - cmp ah,1 ; button id=1 ? - jnz noclose - - mcall -1 ; close this program -;------------------------------------------------------------------------------- -noclose: - cmp ah,2 - jnz notest2 - cli -;------------------------------------------------------------------------------- -notest2: - cmp ah,3 - jnz notest3 - sti -;------------------------------------------------------------------------------- -notest3: - cmp ah,4 - jnz notest4 - mov [0x10000],byte 1 -;------------------------------------------------------------------------------- -notest4: - cmp ah,5 - jnz notest5 - jmp dword 0x10000 -;------------------------------------------------------------------------------- -notest5: - cmp ah,6 - jnz notest6 - mov esp,0 - push eax -;------------------------------------------------------------------------------- -notest6: - cmp ah,7 - jnz notest7 - in al,0x60 -;------------------------------------------------------------------------------- -notest7: - cmp ah,8 - jnz still - out 0x60,al - jmp still -;------------------------------------------------------------------------------- -; ********************************************* -; ******* WINDOW DEFINITIONS AND DRAW ******** -; ********************************************* -;------------------------------------------------------------------------------- -draw_window: - ;mcall 48,3,sys_colors,40 - mcall 12,1 - mcall 0,<200,370>,<200,295>,0x14FFFFFF,,tlabel - mcall 8, <36,15>, <88,15>, 2, 0x6888B8 -.newb: - mcall - add ecx,26*65536 - inc edx - cmp edx,9 - jb .newb - - cld - mov ebx,26*65536+37 ; draw info text with function 4 - mov ecx,0x10000000 - mov edx,text - mov esi,40 - - mov eax,4 -.newline: - mcall - add ebx,13 - add edx,40 - cmp [edx],byte 'x' - jnz .newline - - mcall 12,2 ; function 12:tell os about windowdraw - ret -;------------------------------------------------------------------------------- -; DATA AREA -;------------------------------------------------------------------------------- -if lang eq it_IT -text: - db 'Il programma usa 0x1000 byte di memoria ' - db ' ' - db 'Open debug board for rezult information ' - db ' ' - db ' CLI ' - db ' ' - db ' STI ' - db ' ' - db ' MOV [0x10000],BYTE 1 ' - db ' ' - db ' JMP DWORD 0x10000 ' - db ' ' - db ' MOV ESP,0 & PUSH EAX ' - db ' ' - db ' IN Al,0x60 ' - db ' ' - db ' OUT 0x60,AL ' - db 'x' -else if lang eq ru_RU -text: - db 'Приложение использует 0x1000 байт памяти' - db ' ' - db 'Открыть BOARD для просмотра результата ' - db ' ' - db ' CLI ' - db ' ' - db ' STI ' - db ' ' - db ' MOV [0x10000],BYTE 1 ' - db ' ' - db ' JMP DWORD 0x10000 ' - db ' ' - db ' MOV ESP,0 & PUSH EAX ' - db ' ' - db ' IN Al,0x60 ' - db ' ' - db ' OUT 0x60,AL ' - db 'x' -else -text: - db 'Application uses 0x1000 bytes of memory ' - db ' ' - db 'Open debug board for result information ' - db ' ' - db ' CLI ' - db ' ' - db ' STI ' - db ' ' - db ' MOV [0x10000],BYTE 1 ' - db ' ' - db ' JMP DWORD 0x10000 ' - db ' ' - db ' MOV ESP,0 & PUSH EAX ' - db ' ' - db ' IN Al,0x60 ' - db ' ' - db ' OUT 0x60,AL ' - db 'x' -end if -;------------------------------------------------------------------------------- -if lang eq it_IT -tlabel: - db 'Kolibri prova di protezione',0 -else if lang eq ru_RU -tlabel: - db 'Kolibri проверка защиты ядра',0 -else -tlabel: - db 'Kolibri protection test',0 -end if -;------------------------------------------------------------------------------- -I_END: -;------------------------------------------------------------------------------- -align 4 - rb 256 -stack_top: -;------------------------------------------------------------------------------- -IM_END: -;------------------------------------------------------------------------------- +; SPDX-License-Identifier: NOASSERTION +; + +; Text encoded with Code Page 866 - Cyrillic + +;------------------------------------------------------------------------------- +; +; PROTECTION TEST +; +;------------------------------------------------------------------------------- +; last update: 07/03/2014 +; changed by: Marat Zakiyanov aka Mario79, aka Mario +; changes: Optimisations and code refactoring. +; Reducing the consumption of RAM, 4 KB instead of 64 KB. +; Translation into Russian. +;--------------------------------------------------------------------- +use32 + org 0x0 + + db 'MENUET01' ; 8 byte id + dd 0x01 ; header version + dd START ; start of code + dd I_END ; size of image + dd IM_END ; memory for app + dd stack_top ; esp + dd 0x0 ; I_Param + dd 0x0 ; I_Icon +;------------------------------------------------------------------------------- +include '../../macros.inc' +include 'lang.inc' ; Language support for locales: it_IT, ru_RU (CP866), en_US +;------------------------------------------------------------------------------- +START: ; start of execution +red: ; redraw + call draw_window ; at first, draw the window +;------------------------------------------------------------------------------- +still: + mcall 10 ; wait here for event + cmp eax,1 ; redraw request ? + jz red + + cmp eax,3 ; button in buffer ? + jz button + + cmp eax,2 ; key in buffer ? + jnz still +;------------------------------------------------------------------------------- +key: + mcall 2 ; just read it and ignore + jmp still +;------------------------------------------------------------------------------- +button: + mcall 17 + cmp ah,1 ; button id=1 ? + jnz noclose + + mcall -1 ; close this program +;------------------------------------------------------------------------------- +noclose: + cmp ah,2 + jnz notest2 + cli +;------------------------------------------------------------------------------- +notest2: + cmp ah,3 + jnz notest3 + sti +;------------------------------------------------------------------------------- +notest3: + cmp ah,4 + jnz notest4 + mov [0x10000],byte 1 +;------------------------------------------------------------------------------- +notest4: + cmp ah,5 + jnz notest5 + jmp dword 0x10000 +;------------------------------------------------------------------------------- +notest5: + cmp ah,6 + jnz notest6 + mov esp,0 + push eax +;------------------------------------------------------------------------------- +notest6: + cmp ah,7 + jnz notest7 + in al,0x60 +;------------------------------------------------------------------------------- +notest7: + cmp ah,8 + jnz still + out 0x60,al + jmp still +;------------------------------------------------------------------------------- +; ********************************************* +; ******* WINDOW DEFINITIONS AND DRAW ******** +; ********************************************* +;------------------------------------------------------------------------------- +draw_window: + ;mcall 48,3,sys_colors,40 + mcall 12,1 + mcall 0,<200,370>,<200,295>,0x14FFFFFF,,tlabel + mcall 8, <36,15>, <88,15>, 2, 0x6888B8 +.newb: + mcall + add ecx,26*65536 + inc edx + cmp edx,9 + jb .newb + + cld + mov ebx,26*65536+37 ; draw info text with function 4 + mov ecx,0x10000000 + mov edx,text + mov esi,40 + + mov eax,4 +.newline: + mcall + add ebx,13 + add edx,40 + cmp [edx],byte 'x' + jnz .newline + + mcall 12,2 ; function 12:tell os about windowdraw + ret +;------------------------------------------------------------------------------- +; DATA AREA +;------------------------------------------------------------------------------- +if lang eq it_IT +text: + db 'Il programma usa 0x1000 byte di memoria ' + db ' ' + db 'Open debug board for rezult information ' + db ' ' + db ' CLI ' + db ' ' + db ' STI ' + db ' ' + db ' MOV [0x10000],BYTE 1 ' + db ' ' + db ' JMP DWORD 0x10000 ' + db ' ' + db ' MOV ESP,0 & PUSH EAX ' + db ' ' + db ' IN Al,0x60 ' + db ' ' + db ' OUT 0x60,AL ' + db 'x' +else if lang eq ru_RU +text: + db 'Приложение использует 0x1000 байт памяти' + db ' ' + db 'Открыть BOARD для просмотра результата ' + db ' ' + db ' CLI ' + db ' ' + db ' STI ' + db ' ' + db ' MOV [0x10000],BYTE 1 ' + db ' ' + db ' JMP DWORD 0x10000 ' + db ' ' + db ' MOV ESP,0 & PUSH EAX ' + db ' ' + db ' IN Al,0x60 ' + db ' ' + db ' OUT 0x60,AL ' + db 'x' +else +text: + db 'Application uses 0x1000 bytes of memory ' + db ' ' + db 'Open debug board for result information ' + db ' ' + db ' CLI ' + db ' ' + db ' STI ' + db ' ' + db ' MOV [0x10000],BYTE 1 ' + db ' ' + db ' JMP DWORD 0x10000 ' + db ' ' + db ' MOV ESP,0 & PUSH EAX ' + db ' ' + db ' IN Al,0x60 ' + db ' ' + db ' OUT 0x60,AL ' + db 'x' +end if +;------------------------------------------------------------------------------- +if lang eq it_IT +tlabel: + db 'Kolibri prova di protezione',0 +else if lang eq ru_RU +tlabel: + db 'Kolibri проверка защиты ядра',0 +else +tlabel: + db 'Kolibri protection test',0 +end if +;------------------------------------------------------------------------------- +I_END: +;------------------------------------------------------------------------------- +align 4 + rb 256 +stack_top: +;------------------------------------------------------------------------------- +IM_END: +;-------------------------------------------------------------------------------