forked from KolibriOS/kolibrios
move some apps to the programs/testing folder
git-svn-id: svn://kolibrios.org@7899 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
3
programs/testing/disptest/trunk/Tupfile.lua
Normal file
3
programs/testing/disptest/trunk/Tupfile.lua
Normal file
@@ -0,0 +1,3 @@
|
||||
if tup.getconfig("NO_FASM") ~= "" then return end
|
||||
tup.rule("echo lang fix " .. ((tup.getconfig("LANG") == "") and "en" or tup.getconfig("LANG")) .. " > lang.inc", {"lang.inc"})
|
||||
tup.rule({"disptest.ASM", extra_inputs = {"lang.inc"}}, "fasm %f %o " .. tup.getconfig("KPACK_CMD"), "disptest")
|
5
programs/testing/disptest/trunk/build_en.bat
Normal file
5
programs/testing/disptest/trunk/build_en.bat
Normal file
@@ -0,0 +1,5 @@
|
||||
@echo lang fix en >lang.inc
|
||||
@fasm disptest.asm disptest
|
||||
@erase lang.inc
|
||||
kpack disptest
|
||||
@pause
|
5
programs/testing/disptest/trunk/build_ru.bat
Normal file
5
programs/testing/disptest/trunk/build_ru.bat
Normal file
@@ -0,0 +1,5 @@
|
||||
@echo lang fix ru >lang.inc
|
||||
@fasm disptest.asm disptest
|
||||
@erase lang.inc
|
||||
kpack disptest
|
||||
@pause
|
930
programs/testing/disptest/trunk/disptest.ASM
Normal file
930
programs/testing/disptest/trunk/disptest.ASM
Normal file
@@ -0,0 +1,930 @@
|
||||
;------------------------------------------------------------------------------
|
||||
; Display Test for KolibriOS
|
||||
;------------------------------------------------------------------------------
|
||||
; version: 0.41
|
||||
; last update: 17/03/2012
|
||||
; written by: Marat Zakiyanov aka Mario79, aka Mario
|
||||
; changes: some optimisations and code refactoring
|
||||
;------------------------------------------------------------------------------
|
||||
; compiler: FASM 1.50
|
||||
; name: Display Test
|
||||
; version: 0.4
|
||||
; original author: barsuk
|
||||
|
||||
; <--- include all MeOS stuff --->
|
||||
include "lang.inc"
|
||||
include "../../../macros.inc"
|
||||
|
||||
; <--- start of MenuetOS application --->
|
||||
MEOS_APP_START
|
||||
|
||||
;include "..\..\..\debug.inc"
|
||||
|
||||
|
||||
; <--- start of code --->
|
||||
CODE
|
||||
mcall 37,4,cursor,2
|
||||
or eax, eax
|
||||
jz exit
|
||||
mov [cursorID], eax
|
||||
;------------------------------------------------------------------------------
|
||||
redraw:
|
||||
call draw_window ; at first create and draw the window
|
||||
;------------------------------------------------------------------------------
|
||||
wait_event: ; main cycle
|
||||
xor ebx, ebx
|
||||
mcall 10
|
||||
|
||||
cmp eax, 1 ; if event == 1
|
||||
je redraw ; jump to redraw handler
|
||||
cmp eax, 2 ; else if event == 2
|
||||
je key ; jump to key handler
|
||||
cmp eax, 3 ; else if event == 3
|
||||
je button ; jump to button handler
|
||||
|
||||
jmp wait_event ; else return to the start of main cycle
|
||||
;------------------------------------------------------------------------------
|
||||
key: ; key event handler
|
||||
mcall 2 ; get key code
|
||||
|
||||
cmp ah, 27
|
||||
jz exit
|
||||
|
||||
cmp ah, 0x20
|
||||
jz next_test
|
||||
|
||||
cmp ah, 179 ; ->
|
||||
jz next_test
|
||||
|
||||
cmp ah, 176 ; <-
|
||||
jz prev_test
|
||||
|
||||
cmp ah, 'i'
|
||||
jz toggle_info
|
||||
|
||||
cmp ah, 'I' ; <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20> 祫<> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ))
|
||||
jz toggle_info
|
||||
|
||||
cmp ah, 'c'
|
||||
jz toggle_cursor
|
||||
|
||||
cmp ah, 'C'
|
||||
jz toggle_cursor
|
||||
|
||||
cmp ah, 'd'
|
||||
jz redraw
|
||||
|
||||
cmp ah, 'D'
|
||||
jz redraw
|
||||
|
||||
jmp wait_event
|
||||
;------------------------------------------------------------------------------
|
||||
next_test:
|
||||
cmp dword [test_done], 1
|
||||
jz wait_event
|
||||
|
||||
inc dword [test_num]
|
||||
call draw_window
|
||||
jmp wait_event
|
||||
;------------------------------------------------------------------------------
|
||||
prev_test:
|
||||
cmp dword [test_num], ebx
|
||||
jz wait_event
|
||||
|
||||
dec dword [test_num]
|
||||
mov dword [test_done], ebx
|
||||
call draw_window
|
||||
jmp wait_event
|
||||
;------------------------------------------------------------------------------
|
||||
toggle_info:
|
||||
xor dword [show_info], 1
|
||||
call draw_window
|
||||
jmp wait_event
|
||||
;------------------------------------------------------------------------------
|
||||
toggle_cursor:
|
||||
mov eax, cursorVisible
|
||||
cmp dword [eax], 0
|
||||
jz .no_cursor
|
||||
|
||||
mov dword [eax], 0
|
||||
mov ecx, [cursorID]
|
||||
jmp .set
|
||||
;--------------------------------------
|
||||
.no_cursor:
|
||||
mov dword [eax], 1
|
||||
xor ecx, ecx
|
||||
;--------------------------------------
|
||||
.set:
|
||||
mcall 37,5
|
||||
mcall 18,15 ; <20>⮡<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
jmp wait_event
|
||||
;------------------------------------------------------------------------------
|
||||
button: ; button event handler
|
||||
mcall 17 ; get button identifier
|
||||
cmp ah, 1
|
||||
jne wait_event ; return if button id != 1
|
||||
;--------------------------------------
|
||||
exit:
|
||||
or eax, -1 ; exit application
|
||||
mcall
|
||||
;------------------------------------------------------------------------------
|
||||
draw_window:
|
||||
mcall 12,1
|
||||
|
||||
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
;mov eax, 37
|
||||
;mov ebx, 5
|
||||
;mov ecx, cursorID
|
||||
;int 0x40
|
||||
|
||||
mcall 14 ; screen size
|
||||
|
||||
mov ebx, eax
|
||||
shr ebx, 16
|
||||
mov ecx, eax
|
||||
and ecx, 0xffff
|
||||
mov [screenx], ebx
|
||||
mov [screeny], ecx
|
||||
|
||||
inc ebx
|
||||
inc ecx
|
||||
xor eax, eax ; create and draw the window
|
||||
mov edx, 0x01000000
|
||||
mov esi, edx
|
||||
mcall
|
||||
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>࠭<EFBFBD><E0A0AD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
xor edx, edx
|
||||
mcall 13 ; <20><>㡮 ⠪
|
||||
|
||||
dec ebx
|
||||
dec ecx
|
||||
|
||||
mov eax, [test_num]
|
||||
mov eax, [test_proc + eax*4]
|
||||
or eax, eax
|
||||
jz end_of_test
|
||||
call eax
|
||||
jmp exit_draw
|
||||
;--------------------------------------
|
||||
end_of_test:
|
||||
mcall 4,<8,8>,0xffffff,test_finish,test_finish.size
|
||||
mov dword [test_done], 1
|
||||
jmp no_info
|
||||
;--------------------------------------
|
||||
exit_draw:
|
||||
cmp dword [show_info], 1
|
||||
jnz no_info
|
||||
; ᭮<><E1ADAE> ࠧ<><E0A0A7><EFBFBD><EFBFBD> <20><>࠭<EFBFBD>
|
||||
mov ebx, [screenx]
|
||||
mov ecx, [screeny]
|
||||
; ᣥ<><E1A3A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> ࠧ<><E0A0A7>襭<EFBFBD><E8A5AD><EFBFBD> <20><>࠭<EFBFBD>. <20><> <20>㦭<EFBFBD>, <20><>⮬<EFBFBD> <20><><EFBFBD> <20><><EFBFBD>
|
||||
; <20><>אַ㣮<EFACAE>쭨<EFBFBD> 200<30>40 <20> <20><>䮩
|
||||
mov edx, 200
|
||||
sub ebx, edx
|
||||
shl ebx, 15
|
||||
mov bx, dx
|
||||
mov edx, 40
|
||||
sub ecx, edx
|
||||
shl ecx, 15
|
||||
mov cx, dx
|
||||
mcall 13,,,0xffffff
|
||||
|
||||
xor edx, edx
|
||||
add ebx, 0x0000fffe ; <20>祭<EFBFBD> 㤮<><E3A4AE><EFBFBD> :))))
|
||||
add ecx, 0x0000fffe
|
||||
mcall
|
||||
; ⥪<><E2A5AA>
|
||||
shr ecx, 16
|
||||
mov bx, cx
|
||||
add ebx, 0x00010001
|
||||
mov ecx, 0x80ffffff
|
||||
mov edx, [test_num]
|
||||
mov edx, [test_info + edx*4]
|
||||
mcall 4
|
||||
|
||||
add ebx, 12
|
||||
mcall ,,,press_space
|
||||
|
||||
add ebx, 8
|
||||
mcall ,,,press_i
|
||||
|
||||
add ebx, 8
|
||||
mcall ,,,press_c
|
||||
;--------------------------------------
|
||||
no_info:
|
||||
mcall 12,2
|
||||
ret
|
||||
;------------------------------------------------------------------------------
|
||||
; <---- procedures for various tests of display ----->
|
||||
; in: ebx = screen_width, ecx = screen_height
|
||||
;------------------------------------------------------------------------------
|
||||
lsz i_image_size,\
|
||||
ru, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD> <20> ࠧ<><E0A0A7>饭<EFBFBD><E9A5AD>",\
|
||||
en, "Image Size and Placement"
|
||||
db 0
|
||||
;------------------------------------------------------------------------------
|
||||
t_image_size:
|
||||
mov esi, ebx
|
||||
mov edi, ecx
|
||||
; 6 <20><>१<EFBFBD><E0A5A7><EFBFBD>
|
||||
xor ecx, ecx
|
||||
mcall 38,,,0xffffff
|
||||
|
||||
mov ecx, edi
|
||||
shl ecx, 16
|
||||
xor ebx, ebx
|
||||
mcall
|
||||
|
||||
mov ebx, esi
|
||||
shl ebx, 16
|
||||
add ecx, edi
|
||||
mcall
|
||||
|
||||
sub ecx, edi
|
||||
add ebx, esi
|
||||
mcall
|
||||
; ࠬ<><E0A0AC> <20><>⮢<EFBFBD>
|
||||
mov ebx, esi
|
||||
shl ebx, 16
|
||||
mov ecx, edi
|
||||
shl ecx, 15
|
||||
mov cx, di
|
||||
shr cx, 1
|
||||
mcall
|
||||
|
||||
shr ebx, 1
|
||||
mov bx, si
|
||||
shr bx, 1
|
||||
mov ecx, edi
|
||||
shl ecx, 16
|
||||
mcall
|
||||
ret
|
||||
;------------------------------------------------------------------------------
|
||||
lsz i_grid,\
|
||||
ru, "<22><>⪠",\
|
||||
en, "Grid"
|
||||
db 0
|
||||
;------------------------------------------------------------------------------
|
||||
t_grid:
|
||||
; <20><>⪠ ࠧ<><E0A0A7> <20> 64 <20><><EFBFBD>ᥫ<EFBFBD>
|
||||
mov eax, 38
|
||||
inc ebx
|
||||
inc ecx
|
||||
mov esi, ebx
|
||||
mov edi, ecx
|
||||
mov edx, 0xffffff
|
||||
mov ebp, 0x00400040
|
||||
; <20><>ਧ<EFBFBD><E0A8A7>⠫<EFBFBD><E2A0AB><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||
shl ebx, 16
|
||||
xor ecx, ecx
|
||||
;--------------------------------------
|
||||
grid_next_y:
|
||||
mcall
|
||||
|
||||
add ecx, ebp
|
||||
cmp cx, di
|
||||
jnae grid_next_y
|
||||
sub ecx, 0x00010001
|
||||
mcall
|
||||
; <20><><EFBFBD>⨪<EFBFBD><E2A8AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||
mov ecx, edi
|
||||
shl ecx, 16
|
||||
xor ebx, ebx
|
||||
;--------------------------------------
|
||||
grid_next_x:
|
||||
mcall
|
||||
add ebx, ebp
|
||||
cmp bx, si
|
||||
jnae grid_next_x
|
||||
sub ebx, 0x00010001
|
||||
mcall
|
||||
ret
|
||||
;------------------------------------------------------------------------------
|
||||
lsz i_horstr,\
|
||||
ru, "<22><>ਧ<EFBFBD><E0A8A7>⠫<EFBFBD><E2A0AB><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>",\
|
||||
en, "Horizontal Straightness"
|
||||
db 0
|
||||
;------------------------------------------------------------------------------
|
||||
t_horstr:
|
||||
mov eax, 38
|
||||
mov edi, ecx
|
||||
mov edx, 0xffffff
|
||||
mov esi, ecx
|
||||
inc esi
|
||||
shr esi, 3
|
||||
mov ebp, esi
|
||||
shl ebp, 16
|
||||
mov bp, si
|
||||
; <20><>ਧ<EFBFBD><E0A8A7>⠫<EFBFBD><E2A0AB><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||
shl ebx, 16
|
||||
mov ecx, ebp
|
||||
shr ecx, 1
|
||||
mov cx, bp
|
||||
shr cx, 1
|
||||
;--------------------------------------
|
||||
hor_next_y:
|
||||
mcall
|
||||
add ecx, ebp
|
||||
cmp cx, di
|
||||
jnae hor_next_y
|
||||
ret
|
||||
;------------------------------------------------------------------------------
|
||||
lsz i_vertstr,\
|
||||
ru, "<22><><EFBFBD>⨪<EFBFBD><E2A8AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>",\
|
||||
en, "Vertical Straightness"
|
||||
db 0
|
||||
;------------------------------------------------------------------------------
|
||||
t_vertstr:
|
||||
mov eax, 38
|
||||
mov edx, 0xffffff
|
||||
mov esi, ebx
|
||||
shl ecx, 16
|
||||
mov edi, esi
|
||||
shr edi, 3
|
||||
mov ebp, edi
|
||||
shl ebp, 16
|
||||
mov bp, di
|
||||
mov ebx, ebp
|
||||
shr ebx, 1
|
||||
mov bx, bp
|
||||
shr bx, 1
|
||||
;--------------------------------------
|
||||
vert_next_x:
|
||||
mcall
|
||||
add ebx, ebp
|
||||
cmp bx, si
|
||||
jnae vert_next_x
|
||||
ret
|
||||
;------------------------------------------------------------------------------
|
||||
lsz i_distort,\
|
||||
ru, "<22><EFBFBD>ઠ <20><> <20>᪠<EFBFBD><E1AAA0><EFBFBD><EFBFBD><EFBFBD>",\
|
||||
en, "Distortion",
|
||||
db 0
|
||||
;------------------------------------------------------------------------------
|
||||
t_distort:
|
||||
mov edx, 0xffffff
|
||||
mov esi, ebx
|
||||
mov edi, ecx
|
||||
mov ebp, 3
|
||||
xor ebx, ebx
|
||||
;--------------------------------------
|
||||
dist_next:
|
||||
push ebp
|
||||
mov ebp, ebx
|
||||
shl ebx, 16
|
||||
or ebx, ebp
|
||||
|
||||
mov ecx, edi
|
||||
shl ecx, 16
|
||||
or ecx, ebp
|
||||
mcall 38
|
||||
|
||||
mov ebx, esi
|
||||
shl ebx, 16
|
||||
mov bx, si
|
||||
mcall
|
||||
|
||||
mov bx, bp
|
||||
mov ecx, ebp
|
||||
shl ecx, 16
|
||||
or ecx, ebp
|
||||
mcall
|
||||
|
||||
mov ecx, edi
|
||||
shl ecx, 16
|
||||
mov cx, di
|
||||
mcall
|
||||
|
||||
mov eax, 30
|
||||
sub esi, eax
|
||||
sub edi, eax
|
||||
mov ebx, ebp
|
||||
add ebx, eax
|
||||
pop ebp
|
||||
dec ebp
|
||||
jnz dist_next
|
||||
ret
|
||||
;------------------------------------------------------------------------------
|
||||
lsz i_horres,\
|
||||
ru, "<22><><EFBFBD><EFBFBD><EFBFBD>襭<EFBFBD><E8A5AD> <20><> <20><>ਧ<EFBFBD><E0A8A7>⠫<EFBFBD>",\
|
||||
en, "Horizontal Resolution",
|
||||
db 0
|
||||
;------------------------------------------------------------------------------
|
||||
t_horres:
|
||||
mov eax, 38
|
||||
mov edx, 0xffffff
|
||||
mov edi, ecx
|
||||
shl ecx, 16
|
||||
mov esi, ebx
|
||||
xor ebx, ebx
|
||||
mov edi, 0x003A003A
|
||||
mov ebp, 0x00030003
|
||||
;--------------------------------------
|
||||
horres_next:
|
||||
add ebx, edi
|
||||
mcall
|
||||
|
||||
add ebx, ebp
|
||||
mcall
|
||||
|
||||
add ebx, ebp
|
||||
mcall
|
||||
|
||||
add ebx, ebp
|
||||
mcall
|
||||
|
||||
add ebx, ebp
|
||||
mcall
|
||||
|
||||
cmp bx, si
|
||||
jna horres_next
|
||||
ret
|
||||
;------------------------------------------------------------------------------
|
||||
lsz i_vertres,\
|
||||
ru, "<22><><EFBFBD><EFBFBD><EFBFBD>襭<EFBFBD><E8A5AD> <20><> <20><><EFBFBD>⨪<EFBFBD><E2A8AA><EFBFBD>",\
|
||||
en, "Vertical Resolution",
|
||||
db 0
|
||||
;------------------------------------------------------------------------------
|
||||
t_vertres:
|
||||
mov eax, 38
|
||||
mov edx, 0xffffff
|
||||
; mov esi, ebx
|
||||
shl ebx, 16
|
||||
mov edi, ecx
|
||||
xor ecx, ecx
|
||||
mov ebp, 0x00030003
|
||||
mov esi, 0x002A002A
|
||||
;--------------------------------------
|
||||
vertres_next:
|
||||
add ecx, esi
|
||||
mcall
|
||||
|
||||
add ecx, ebp
|
||||
mcall
|
||||
|
||||
add ecx, ebp
|
||||
mcall
|
||||
|
||||
add ecx, ebp
|
||||
mcall
|
||||
|
||||
add ecx, ebp
|
||||
mcall
|
||||
|
||||
add ecx, 0x00540054
|
||||
cmp cx, di
|
||||
jna vertres_next
|
||||
ret
|
||||
;------------------------------------------------------------------------------
|
||||
lsz i_moire,\
|
||||
ru, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>",\
|
||||
en, "Moire Patterns",
|
||||
db 0
|
||||
;------------------------------------------------------------------------------
|
||||
t_moire:
|
||||
mov eax, 38
|
||||
mov edx, 0xffffff
|
||||
mov edi, ecx
|
||||
shl ecx, 16
|
||||
mov esi, ebx
|
||||
xor ebx, ebx
|
||||
mov ebp, 0x00030003
|
||||
;--------------------------------------
|
||||
moire_next:
|
||||
mcall
|
||||
add ebx, ebp
|
||||
cmp bx, si
|
||||
jna moire_next
|
||||
ret
|
||||
;------------------------------------------------------------------------------
|
||||
lsz i_revsharp,\
|
||||
ru, "<22><><EFBFBD><EFBFBD><EFBFBD>ᨢ<EFBFBD><E1A8A2><EFBFBD> १<><E0A5A7><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>",\
|
||||
en, "Reverse Video Sharpness",
|
||||
db 0
|
||||
;------------------------------------------------------------------------------
|
||||
t_revsharp:
|
||||
mov esi, ebx
|
||||
mov edi, ecx
|
||||
shr ecx, 1
|
||||
mcall 13,,,0xffffff
|
||||
; <20> ⥯<><E2A5AF><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||
mov eax, 38
|
||||
mov ecx, edi
|
||||
mov edx, 0x01000000
|
||||
xor ebx, ebx
|
||||
mov ebp, 0x00010001
|
||||
mov edi, 0x003F003F
|
||||
;--------------------------------------
|
||||
revsharp_next:
|
||||
add ebx, edi
|
||||
mcall
|
||||
|
||||
add ebx, ebp
|
||||
mcall
|
||||
|
||||
add ebx, ebp
|
||||
mcall
|
||||
|
||||
add ebx, edi
|
||||
sub ebx, ebp
|
||||
mcall
|
||||
|
||||
cmp bx, si
|
||||
jna revsharp_next
|
||||
ret
|
||||
;------------------------------------------------------------------------------
|
||||
lsz i_flicker,\
|
||||
ru, "<22><EFBFBD><E0AEA2><EFBFBD> <20><><EFBFBD>栭<EFBFBD><E6A0AD>",\
|
||||
en, "Flicker Severity",
|
||||
db 0
|
||||
;------------------------------------------------------------------------------
|
||||
t_flicker:
|
||||
mcall 13,,,0xffffff
|
||||
ret
|
||||
;------------------------------------------------------------------------------
|
||||
lsz i_glare,\
|
||||
ru, "<22><EFBFBD><E0AEA2><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ᢥ⪨",\
|
||||
en, "Glare Severity",
|
||||
db 0
|
||||
;------------------------------------------------------------------------------
|
||||
t_glare: ; <20><>⨬<EFBFBD><E2A8AC><EFBFBD><EFBFBD><E0AEA2><EFBFBD> <20><>祣<EFBFBD>
|
||||
ret
|
||||
;------------------------------------------------------------------------------
|
||||
lsz i_interlace,\
|
||||
ru, "<22><><EFBFBD><EFBFBD><EFBFBD>㦥<EFBFBD><E3A6A5><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ᨭ<EFBFBD><E1A8AD>",\
|
||||
en, "Interlacing Detection",
|
||||
db 0
|
||||
;------------------------------------------------------------------------------
|
||||
t_interlace:
|
||||
mov edi, ecx
|
||||
mov eax, 38
|
||||
mov edx, 0xffffff
|
||||
xor ecx, ecx
|
||||
mov ebp, 0x00020002
|
||||
;--------------------------------------
|
||||
interlace_next:
|
||||
add ecx, ebp
|
||||
mcall
|
||||
cmp cx, di
|
||||
jna interlace_next
|
||||
ret
|
||||
;------------------------------------------------------------------------------
|
||||
lsz i_scrreg,\
|
||||
ru, "<22><><EFBFBD>㫨<E3ABA8><E0AEA2> <20><>࠭<EFBFBD>",\
|
||||
en, "Screen Regulation",
|
||||
db 0
|
||||
;------------------------------------------------------------------------------
|
||||
t_scrreg:
|
||||
add ebx, 0x0018FFCD ; +25 <20> <20><>砫<EFBFBD> <20> -50 <20><> <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||
shr ecx, 1
|
||||
add ecx, 0x0013FFEC ; +19 <20> <20><>砫<EFBFBD> <20> -19 <20><> <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||
mcall 13,,,0xffffff
|
||||
ret
|
||||
;------------------------------------------------------------------------------
|
||||
lsz i_pricol,\
|
||||
ru, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>᭮<EFBFBD><E1ADAE><EFBFBD><EFBFBD> 梥⮢",\
|
||||
en, "Primary Color Purity",
|
||||
db 0
|
||||
;------------------------------------------------------------------------------
|
||||
t_pricol:
|
||||
mov esi, ebx
|
||||
mov edi, ecx
|
||||
|
||||
shr ebx, 4 ; /16
|
||||
mov ebp, ebx
|
||||
shl ebx, 16
|
||||
mov bx, bp
|
||||
shl ebp, 16
|
||||
lea ebp, [ebp + ebp * 4] ; ebp *= 5
|
||||
|
||||
mov ecx, 0x00280000
|
||||
mov cx, di
|
||||
sub cx, 80
|
||||
;shr cx, 1
|
||||
|
||||
shl bx, 2
|
||||
mcall 13,,,0xff0000
|
||||
|
||||
add ebx, ebp
|
||||
shr edx, 8
|
||||
mcall
|
||||
|
||||
add ebx, ebp
|
||||
shr edx, 8
|
||||
mcall
|
||||
ret
|
||||
;------------------------------------------------------------------------------
|
||||
lsz i_colint,\
|
||||
ru, "<22>ࠤ<EFBFBD><E0A0A4><EFBFBD><EFBFBD> <20><>⥭ᨢ<E2A5AD><E1A8A2><EFBFBD><EFBFBD><EFBFBD> 梥<><E6A2A5>",\
|
||||
en, "Color Intensity Gradient",
|
||||
db 0
|
||||
;------------------------------------------------------------------------------
|
||||
t_colint:
|
||||
|
||||
mov esi, ebx
|
||||
mov edi, ecx
|
||||
|
||||
; mov eax, ecx
|
||||
; shr ecx, 2 ; end y coord
|
||||
; and ecx, 0xffffff80 ; <20><><EFBFBD> not 7F
|
||||
; shr eax, 7 ; / 128
|
||||
; mov ebp, eax
|
||||
; mov edx, eax
|
||||
; lea eax, [eax + eax * 2] ; eax *= 5
|
||||
; shl ebp, 4
|
||||
; add eax, ebp
|
||||
|
||||
; shl eax, 16
|
||||
; add ecx, eax
|
||||
; mov edx, ebp
|
||||
; shl ebp, 16
|
||||
; mov bp, dx ; <20><> <20><><EFBFBD>쭮<EFBFBD>
|
||||
|
||||
; <20> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD> ⠬ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20> <20><>訫 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᭮<><E1ADAE> <20>_<EFBFBD>
|
||||
|
||||
; <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> ᣥ<><E1A3A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ecx (<28><>砫<EFBFBD><E7A0AB><EFBFBD><EFBFBD> ᤢ<><E1A4A2>) <20> ebp (蠣 <20><> <20>)
|
||||
|
||||
mov eax, edi
|
||||
lea eax, [eax + 2 * eax]
|
||||
shr eax, 5 ; eax = 3/32 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
mov ebp, eax
|
||||
shl ebp, 16
|
||||
mov bp, ax ; ebp = ax <20> <20><><EFBFBD><EFBFBD><EFBFBD> <><E1ABAE><EFBFBD>
|
||||
|
||||
mov ebx, eax ; <20><><EFBFBD>࠭<EFBFBD><E0A0AD> <20><><EFBFBD> <20><><EFBFBD>祭<EFBFBD><E7A5AD>
|
||||
|
||||
mov eax, edi
|
||||
inc eax
|
||||
shr eax, 4 ; 3/16 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <20><>砫쭮<E7A0AB> <20><><EFBFBD>祭<EFBFBD><E7A5AD>
|
||||
; <20>ᥣ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 3/4 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20>⮣<EFBFBD> <20><> 3/32 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28><><EFBFBD> <><E0AEA2><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>)
|
||||
lea eax, [eax + eax * 2]
|
||||
mov ecx, eax
|
||||
shl ecx, 16
|
||||
shr ebx, 2
|
||||
lea ebx, [ebx + ebx * 2] ; ebx = 3/4 ebx, <20>.<2E>. 3/4 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
add eax, ebx
|
||||
mov cx, ax
|
||||
|
||||
xor edx, edx
|
||||
mov eax, 0xffff
|
||||
div esi
|
||||
mov edi, eax ; edi = 64K/width
|
||||
|
||||
mov dword [color_index], 0
|
||||
jmp colint_next
|
||||
;------------------------------------------------------------------------------
|
||||
color_table dd 0x00ff0000, 0x0000ff00, 0x00ffff00, \
|
||||
0x000000ff, 0x00ff00ff, 0x0000ffff, 0x00ffffff
|
||||
color_index dd 0
|
||||
;------------------------------------------------------------------------------
|
||||
colint_next:
|
||||
xor edx, edx
|
||||
xor ebx, ebx
|
||||
mov eax, 38
|
||||
;--------------------------------------
|
||||
colint_next_line:
|
||||
push edx
|
||||
push eax
|
||||
movzx eax, dh
|
||||
shl eax, 16
|
||||
mov dl, dh
|
||||
or edx, eax
|
||||
mov eax, [color_index]
|
||||
mov eax, [color_table + eax * 4]
|
||||
and edx, eax
|
||||
pop eax
|
||||
mcall
|
||||
pop edx
|
||||
add ebx, 0x00010001
|
||||
add edx, edi
|
||||
cmp bx, si
|
||||
jna colint_next_line
|
||||
|
||||
add ecx, ebp
|
||||
inc dword [color_index]
|
||||
cmp dword [color_index], 7
|
||||
jb colint_next
|
||||
ret
|
||||
;------------------------------------------------------------------------------
|
||||
lsz i_colalign,\
|
||||
ru, "<22><><EFBFBD>⮢<EFBFBD><E2AEA2> <20><>ࠢ<EFBFBD><E0A0A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",\
|
||||
en, "Color Alignment Grid",
|
||||
db 0
|
||||
;------------------------------------------------------------------------------
|
||||
t_colalign:
|
||||
; <20><><EFBFBD>᭠<EFBFBD> <20><>⪠
|
||||
inc ebx ; ⠪ <20>㦭<EFBFBD>
|
||||
inc ecx
|
||||
mov esi, ebx
|
||||
mov edi, ecx
|
||||
mov edx, 0xff0000
|
||||
; <20><>ਧ<EFBFBD><E0A8A7>⠫<EFBFBD><E2A0AB><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||
shl ebx, 16
|
||||
xor ecx, ecx
|
||||
push edi
|
||||
shr edi, 3
|
||||
mov ebp, edi
|
||||
shl ebp, 16
|
||||
mov bp, di
|
||||
pop edi
|
||||
mov [yshift], ebp
|
||||
mov eax, 38
|
||||
;--------------------------------------
|
||||
cgrid_next_y:
|
||||
mcall
|
||||
add ecx, ebp
|
||||
cmp cx, di
|
||||
jnae cgrid_next_y
|
||||
; <20><><EFBFBD><E1ABA5><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>:
|
||||
sub ecx, 0x00010001
|
||||
mcall
|
||||
|
||||
; <20><><EFBFBD>⨪<EFBFBD><E2A8AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||
mov ecx, edi
|
||||
shl ecx, 16
|
||||
xor ebx, ebx
|
||||
push esi
|
||||
shr esi, 3
|
||||
mov ebp, esi
|
||||
shl ebp, 16
|
||||
mov bp, si
|
||||
mov [xshift], ebp
|
||||
pop esi
|
||||
mov eax, 38
|
||||
;--------------------------------------
|
||||
cgrid_next_x:
|
||||
mcall
|
||||
add ebx, ebp
|
||||
cmp bx, si
|
||||
jnae cgrid_next_x
|
||||
; <20><><EFBFBD><E1ABA5><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||
sub ebx, 0x00010001
|
||||
mcall
|
||||
jmp cgrid_green
|
||||
;------------------------------------------------------------------------------
|
||||
xshift dd 0
|
||||
yshift dd 0
|
||||
shift dd 0
|
||||
;------------------------------------------------------------------------------
|
||||
cgrid_green:
|
||||
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>: <20><>ਧ<EFBFBD><E0A8A7>⠫<EFBFBD><E2A0AB><EFBFBD><EFBFBD>
|
||||
mov edx, esi
|
||||
shr edx, 5
|
||||
lea eax, [edx + edx * 2]
|
||||
shl edx, 16
|
||||
or edx, eax
|
||||
mov [shift], edx
|
||||
mov eax, 38
|
||||
mov edx, 0x00ff00
|
||||
xor ecx, ecx
|
||||
mov ebp, [xshift]
|
||||
;--------------------------------------
|
||||
ggrid_next_yy:
|
||||
mov ebx, [shift]
|
||||
;--------------------------------------
|
||||
ggrid_next_yx:
|
||||
mcall
|
||||
add ebx, ebp
|
||||
cmp bx, si
|
||||
jnae ggrid_next_yx
|
||||
sub ebx, 0x00010001
|
||||
mcall
|
||||
|
||||
add ecx, [yshift]
|
||||
cmp cx, di
|
||||
jnae ggrid_next_yy
|
||||
; last row of lines
|
||||
mov ebx, [shift]
|
||||
dec ecx
|
||||
;--------------------------------------
|
||||
ggrid_last_yx:
|
||||
mcall
|
||||
add ebx, ebp
|
||||
cmp bx, si
|
||||
jnae ggrid_last_yx
|
||||
|
||||
; <20> <20><><EFBFBD>⨪<EFBFBD><E2A8AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
mov edx, edi
|
||||
shr edx, 5
|
||||
lea eax, [edx + edx * 2]
|
||||
shl edx, 16
|
||||
or edx, eax
|
||||
mov [shift], edx
|
||||
|
||||
mov eax, 38
|
||||
mov edx, 0x00ff00
|
||||
mov ecx, [shift]
|
||||
mov ebp, [xshift]
|
||||
;--------------------------------------
|
||||
ggrid_next_xy:
|
||||
xor ebx, ebx
|
||||
;--------------------------------------
|
||||
ggrid_next_xx:
|
||||
mcall
|
||||
|
||||
add ebx, ebp
|
||||
cmp bx, si
|
||||
jnae ggrid_next_xx
|
||||
sub ebx, 0x00010001
|
||||
mcall
|
||||
|
||||
add ecx, [yshift]
|
||||
cmp cx, di
|
||||
jnae ggrid_next_xy
|
||||
xor ebx, ebx
|
||||
dec ecx
|
||||
;--------------------------------------
|
||||
ggrid_last_xy:
|
||||
;int 0x40
|
||||
;add ebx, ebp
|
||||
;cmp bx, si
|
||||
;jnae ggrid_last_xy
|
||||
ret
|
||||
;------------------------------------------------------------------------------
|
||||
lsz i_colsyn,\
|
||||
ru, "<22><><EFBFBD><EFBFBD><EFBFBD><E0AEAD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 梥<><E6A2A5>",\
|
||||
en, "Color Synchronization",
|
||||
db 0
|
||||
;------------------------------------------------------------------------------
|
||||
t_colsyn:
|
||||
inc ebx
|
||||
inc ecx
|
||||
mov esi, ebx
|
||||
mov edi, ecx
|
||||
|
||||
shr ebx, 5
|
||||
mov eax, ebx
|
||||
lea ebx, [ebx + ebx * 4]
|
||||
shl ebx, 1 ; 10/32
|
||||
mov ebp, ebx
|
||||
shl eax, 16
|
||||
or ebx, eax
|
||||
shl ebp, 16
|
||||
|
||||
mov edi, 0x0000ffff
|
||||
add ecx, 0x003FFF7F
|
||||
mov edx, edi
|
||||
mcall 13
|
||||
|
||||
mov edx, 0x00ff0000
|
||||
add ebx, ebp
|
||||
mcall
|
||||
|
||||
mov edx, edi
|
||||
add ebx, ebp
|
||||
mcall
|
||||
ret
|
||||
;------------------------------------------------------------------------------
|
||||
; <--- initialised data --->
|
||||
DATA
|
||||
screenx dd 0
|
||||
screeny dd 0
|
||||
|
||||
test_num dd 0
|
||||
test_done dd 0
|
||||
show_info dd 1
|
||||
test_proc dd t_image_size, t_grid, t_horstr, t_vertstr,\
|
||||
t_distort, t_horres, t_vertres, t_moire, t_revsharp, \
|
||||
t_flicker, t_glare, t_interlace, t_scrreg, t_pricol, \
|
||||
t_colint, t_colalign, t_colsyn, 0
|
||||
test_info dd i_image_size, i_grid, i_horstr, i_vertstr, \
|
||||
i_distort, i_horres, i_vertres, i_moire, i_revsharp, \
|
||||
i_flicker, i_glare, i_interlace, i_scrreg, i_pricol, \
|
||||
i_colint, i_colalign, i_colsyn, 0
|
||||
|
||||
lsz press_space,\
|
||||
ru, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><E0AEA1> <20><><EFBFBD> <20>த<EFBFBD><E0AEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,",\
|
||||
en, "Press 'Space' key to continue",
|
||||
db 0
|
||||
|
||||
lsz press_i,\
|
||||
ru, "I <20><><EFBFBD> <20><>४<EFBFBD><E0A5AA>祭<EFBFBD><E7A5AD> ᢥ<><E1A2A5><EFBFBD><EFBFBD><EFBFBD>,",\
|
||||
en, "I to turn details on and off ",
|
||||
db 0
|
||||
|
||||
lsz press_c,\
|
||||
ru, "<22> C <20><><EFBFBD> <20><>४<EFBFBD><E0A5AA>祭<EFBFBD><E7A5AD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",\
|
||||
en, "and C to show and hide cursor",
|
||||
db 0
|
||||
|
||||
lsz header,\
|
||||
ru, "<22><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",\
|
||||
en, "Display test",
|
||||
db 0
|
||||
|
||||
lsz test_finish,\
|
||||
ru, "<22><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ESC.",\
|
||||
en, "Test has been finished. Press ESC.",
|
||||
db 0
|
||||
|
||||
cursor dd 32*32 dup(0x00000000) ; <20><><EFBFBD> ࠢ<><E0A0A2> ᮦ<><E1AEA6><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
cursorVisible dd 1
|
||||
cursorID dd 0
|
||||
;------------------------------------------------------------------------------
|
||||
; <--- uninitialised data --->
|
||||
UDATA
|
||||
;------------------------------------------------------------------------------
|
||||
MEOS_APP_END
|
||||
; <--- end of MenuetOS application --->
|
||||
;------------------------------------------------------------------------------
|
13
programs/testing/disptest/trunk/readme.txt
Normal file
13
programs/testing/disptest/trunk/readme.txt
Normal file
@@ -0,0 +1,13 @@
|
||||
disptest v0.3
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: CheckIt 98.
|
||||
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
i - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
d - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
c - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
esc - <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
barsuk
|
3
programs/testing/fspeed/Tupfile.lua
Normal file
3
programs/testing/fspeed/Tupfile.lua
Normal file
@@ -0,0 +1,3 @@
|
||||
if tup.getconfig("NO_FASM") ~= "" then return end
|
||||
tup.rule("echo lang fix " .. ((tup.getconfig("LANG") == "") and "en" or tup.getconfig("LANG")) .. " > lang.inc", {"lang.inc"})
|
||||
tup.rule({"fspeed.asm", extra_inputs = {"lang.inc"}}, "fasm %f %o " .. tup.getconfig("KPACK_CMD"), "fspeed")
|
6
programs/testing/fspeed/build_en.bat
Normal file
6
programs/testing/fspeed/build_en.bat
Normal file
@@ -0,0 +1,6 @@
|
||||
@erase lang.inc
|
||||
@echo lang fix en >lang.inc
|
||||
@fasm fspeed.asm fspeed
|
||||
@kpack fspeed
|
||||
@erase lang.inc
|
||||
@pause
|
6
programs/testing/fspeed/build_ru.bat
Normal file
6
programs/testing/fspeed/build_ru.bat
Normal file
@@ -0,0 +1,6 @@
|
||||
@erase lang.inc
|
||||
@echo lang fix ru >lang.inc
|
||||
@fasm fspeed.asm fspeed
|
||||
@kpack fspeed
|
||||
@erase lang.inc
|
||||
@pause
|
353
programs/testing/fspeed/fspeed.asm
Normal file
353
programs/testing/fspeed/fspeed.asm
Normal file
@@ -0,0 +1,353 @@
|
||||
;*****************************************************************************
|
||||
; File Speed - for Kolibri OS
|
||||
; Copyright (c) 2014, Marat Zakiyanov aka Mario79, aka Mario
|
||||
; All rights reserved.
|
||||
;
|
||||
; Redistribution and use in source and binary forms, with or without
|
||||
; modification, are permitted provided that the following conditions are met:
|
||||
; * Redistributions of source code must retain the above copyright
|
||||
; notice, this list of conditions and the following disclaimer.
|
||||
; * Redistributions in binary form must reproduce the above copyright
|
||||
; notice, this list of conditions and the following disclaimer in the
|
||||
; documentation and/or other materials provided with the distribution.
|
||||
; * Neither the name of the <organization> nor the
|
||||
; names of its contributors may be used to endorse or promote products
|
||||
; derived from this software without specific prior written permission.
|
||||
;
|
||||
; THIS SOFTWARE IS PROVIDED BY Marat Zakiyanov ''AS IS'' AND ANY
|
||||
; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
; DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
|
||||
; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
;*****************************************************************************
|
||||
;-----------------------------------------------------------------------------
|
||||
use32
|
||||
org 0x0
|
||||
db 'MENUET01'
|
||||
dd 0x01
|
||||
dd START
|
||||
dd IM_END
|
||||
dd I_END
|
||||
dd STACK_TOP
|
||||
dd 0x0
|
||||
dd cur_dir_path
|
||||
;-----------------------------------------------------------------------------
|
||||
include 'lang.inc'
|
||||
include '../../macros.inc'
|
||||
define __DEBUG__ 1
|
||||
define __DEBUG_LEVEL__ 1
|
||||
include '../../debug-fdo.inc'
|
||||
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
|
||||
include '../../develop/libraries/box_lib/load_lib.mac'
|
||||
@use_library
|
||||
;-----------------------------------------------------------------------------
|
||||
struct RESULT_SLOT
|
||||
text dd ?
|
||||
read_speed dd ?
|
||||
write_speed dd ?
|
||||
chunk_size dd ?
|
||||
ends
|
||||
;-----------------------------------------------------------------------------
|
||||
START:
|
||||
DEBUGF 1,'FSPEED: start of programm\n'
|
||||
;-----------------------------------------------------------------------------
|
||||
mcall 68,11
|
||||
test eax,eax
|
||||
jz exit
|
||||
;-----------------------------------------------------------------------------
|
||||
load_libraries l_libs_start,end_l_libs
|
||||
;if return code =-1 then exit, else nornary work
|
||||
inc eax
|
||||
test eax,eax
|
||||
jz exit
|
||||
;-----------------------------------------------------------------------------
|
||||
;OpenDialog initialisation
|
||||
push dword OpenDialog_data
|
||||
call [OpenDialog_Init]
|
||||
|
||||
push check1
|
||||
call [init_checkbox]
|
||||
|
||||
mcall 40,0x27
|
||||
;-----------------------------------------------------------------------------
|
||||
red:
|
||||
call draw_window
|
||||
;-----------------------------------------------------------------------------
|
||||
still:
|
||||
mcall 10
|
||||
cmp eax,1
|
||||
je red
|
||||
|
||||
cmp eax,2
|
||||
je key
|
||||
|
||||
cmp eax,3
|
||||
je button
|
||||
|
||||
push dword check1
|
||||
call [check_box_mouse]
|
||||
|
||||
jmp still
|
||||
;-----------------------------------------------------------------------------
|
||||
key:
|
||||
mcall 2
|
||||
jmp still
|
||||
;-----------------------------------------------------------------------------
|
||||
button:
|
||||
mcall 17
|
||||
|
||||
cmp ah,2
|
||||
je select_file
|
||||
|
||||
cmp ah,3
|
||||
je testing
|
||||
|
||||
cmp ah,1
|
||||
jne still
|
||||
;--------------------------------------
|
||||
exit:
|
||||
mcall -1
|
||||
;-----------------------------------------------------------------------------
|
||||
select_file:
|
||||
; invoke OpenDialog
|
||||
mov [OpenDialog_data.type],dword 0
|
||||
push dword OpenDialog_data
|
||||
call [OpenDialog_Start]
|
||||
cmp [OpenDialog_data.status],1
|
||||
jne still
|
||||
; prepare for PathShow
|
||||
push dword PathShow_data
|
||||
call [PathShow_prepare]
|
||||
|
||||
call draw_PathShow
|
||||
jmp still
|
||||
;-----------------------------------------------------------------------------
|
||||
draw_PathShow:
|
||||
mcall 13,<5,400-20>,<5,15>,0xffffff
|
||||
; draw for PathShow
|
||||
push dword PathShow_data
|
||||
call [PathShow_draw]
|
||||
ret
|
||||
;-----------------------------------------------------------------------------
|
||||
draw_window:
|
||||
mcall 48,3,app_colours,4*10 ; get current colors
|
||||
|
||||
mcall 12,1
|
||||
xor esi,esi
|
||||
xor ebp,ebp
|
||||
mov edx,[w_work] ; color of work area RRGGBB,8->color
|
||||
or edx,0x34000000
|
||||
mcall 0,<100,400>,<100,300>,,,title
|
||||
|
||||
call draw_PathShow
|
||||
mov eax,[w_work_text]
|
||||
or eax,0x80000000
|
||||
mov [check1.text_color],eax
|
||||
push dword check1
|
||||
call [check_box_draw]
|
||||
|
||||
mcall 8,<5,80>,<25,15>,2,[w_work_button]
|
||||
mcall ,<400-65,50>,,3
|
||||
mov ecx,[w_work_button_text]
|
||||
or ecx,0x80000000
|
||||
mcall 4,<5+10,25+4>,,s_text
|
||||
mcall ,<400-65+10,25+4>,,r_text
|
||||
mov ecx,[w_work_text]
|
||||
or ecx,0x80000000
|
||||
mcall ,<10,47>,,check_box_warning_text
|
||||
mcall ,<10,65>,,result_table_text
|
||||
|
||||
mov edx,ecx
|
||||
and edx,0xffffff
|
||||
mcall 38,<5,400-15>,<59,59>
|
||||
; draw result table
|
||||
mov ebx,10 shl 16+77
|
||||
mov ebp,result_table
|
||||
mov ecx,18
|
||||
;--------------------------------------
|
||||
@@:
|
||||
push ecx
|
||||
mov ecx,[w_work_text]
|
||||
or ecx,0x80000000
|
||||
mcall 4,,,[ebp+RESULT_SLOT.text]
|
||||
push ebx
|
||||
mov edx,ebx
|
||||
add edx,(11*6) shl 16
|
||||
mov ebx,0x800a0000
|
||||
mcall 47,,[ebp+RESULT_SLOT.read_speed],,[w_work_text]
|
||||
add edx,(16*6) shl 16
|
||||
mcall ,,[ebp+RESULT_SLOT.write_speed]
|
||||
pop ebx
|
||||
add ebx,6+5
|
||||
add ebp,sizeof.RESULT_SLOT
|
||||
pop ecx
|
||||
dec ecx
|
||||
jnz @b
|
||||
|
||||
mcall 12,2
|
||||
ret
|
||||
;-----------------------------------------------------------------------------;-----------------------------------------------------------------------------
|
||||
testing:
|
||||
mcall 70,fileinfo
|
||||
test eax,eax
|
||||
jz @f
|
||||
|
||||
DEBUGF 1,'FSPEED: file not found %s\n',fname
|
||||
jmp still
|
||||
;--------------------------------------
|
||||
@@:
|
||||
DEBUGF 1,'FSPEED: target file %s\n',fname
|
||||
mov ebp,result_table
|
||||
mov ecx,18
|
||||
;--------------------------------------
|
||||
@@:
|
||||
push ecx
|
||||
call read_chunk
|
||||
|
||||
pusha
|
||||
call draw_window
|
||||
popa
|
||||
|
||||
call write_chunk
|
||||
|
||||
pusha
|
||||
call draw_window
|
||||
popa
|
||||
|
||||
pop ecx
|
||||
add ebp,sizeof.RESULT_SLOT
|
||||
|
||||
dec ecx
|
||||
jnz @b
|
||||
|
||||
jmp still
|
||||
;-----------------------------------------------------------------------------
|
||||
read_chunk:
|
||||
mov eax,[file_info+32] ; file size
|
||||
cmp [ebp+RESULT_SLOT.chunk_size],eax
|
||||
jb @f
|
||||
|
||||
xor eax,eax ; small file size for current chunk size
|
||||
mov [ebp+RESULT_SLOT.read_speed],eax
|
||||
ret
|
||||
;--------------------------------------
|
||||
@@:
|
||||
mcall 68,12,[ebp+RESULT_SLOT.chunk_size]
|
||||
mov [fileread.return],eax
|
||||
xor eax,eax
|
||||
mov [fileread.offset],eax ; zero current offset
|
||||
mcall 26,9 ; get start time
|
||||
add eax,1600 ; 16 sec for iterations
|
||||
mov esi,eax
|
||||
mov ecx,1
|
||||
mov eax,[ebp+RESULT_SLOT.chunk_size]
|
||||
mov [fileread.size],eax
|
||||
;--------------------------------------
|
||||
.loop:
|
||||
mcall 70,fileread
|
||||
|
||||
mcall 26,9 ; check current time
|
||||
cmp esi,eax
|
||||
jbe .end
|
||||
; correct offset
|
||||
mov edx,[ebp+RESULT_SLOT.chunk_size]
|
||||
add [fileread.offset],edx ; current offset
|
||||
; check offset and file size
|
||||
mov edx,[file_info+32] ; file size
|
||||
sub edx,[ebp+RESULT_SLOT.chunk_size]
|
||||
cmp [fileread.offset],edx
|
||||
jbe @f
|
||||
|
||||
xor edx,edx
|
||||
mov [fileread.offset],edx ; zero current offset
|
||||
;--------------------------------------
|
||||
@@:
|
||||
inc ecx
|
||||
jmp .loop
|
||||
;--------------------------------------
|
||||
.end:
|
||||
mov eax,[ebp+RESULT_SLOT.chunk_size]
|
||||
xor edx,edx
|
||||
mul ecx
|
||||
shr eax,10+4 ;div 1024 ; div 16
|
||||
shl edx,18
|
||||
add eax,edx
|
||||
mov [ebp+RESULT_SLOT.read_speed],eax ; speed KB/s
|
||||
DEBUGF 1,'FSPEED: read chunk size: %s iterations: %d speed: %d KB/s\n',\
|
||||
[ebp+RESULT_SLOT.text],ecx,eax
|
||||
mcall 68,13,[fileread.return]
|
||||
ret
|
||||
;-----------------------------------------------------------------------------
|
||||
write_chunk:
|
||||
test [check1.flags],dword 10b
|
||||
jz .exit
|
||||
|
||||
mov eax,[file_info+32] ; file size
|
||||
cmp [ebp+RESULT_SLOT.chunk_size],eax
|
||||
jb @f
|
||||
;--------------------------------------
|
||||
.exit:
|
||||
xor eax,eax ; small file size for current chunk size
|
||||
mov [ebp+RESULT_SLOT.write_speed],eax
|
||||
ret
|
||||
;--------------------------------------
|
||||
@@:
|
||||
mcall 68,12,[ebp+RESULT_SLOT.chunk_size]
|
||||
mov [filewrite.data],eax
|
||||
xor eax,eax
|
||||
mov [filewrite.offset],eax ; zero current offset
|
||||
mcall 26,9 ; get start time
|
||||
add eax,1600 ; 16 sec for iterations
|
||||
mov esi,eax
|
||||
mov ecx,1
|
||||
mov eax,[ebp+RESULT_SLOT.chunk_size]
|
||||
mov [filewrite.size],eax
|
||||
;--------------------------------------
|
||||
.loop:
|
||||
mcall 70,filewrite
|
||||
|
||||
mcall 26,9 ; check current time
|
||||
cmp esi,eax
|
||||
jbe .end
|
||||
; correct offset
|
||||
mov edx,[ebp+RESULT_SLOT.chunk_size]
|
||||
add [filewrite.offset],edx ; current offset
|
||||
; check offset and file size
|
||||
mov edx,[file_info+32] ; file size
|
||||
sub edx,[ebp+RESULT_SLOT.chunk_size]
|
||||
cmp [filewrite.offset],edx
|
||||
jbe @f
|
||||
|
||||
xor edx,edx
|
||||
mov [filewrite.offset],edx ; zero current offset
|
||||
;--------------------------------------
|
||||
@@:
|
||||
inc ecx
|
||||
jmp .loop
|
||||
;--------------------------------------
|
||||
.end:
|
||||
mov eax,[ebp+RESULT_SLOT.chunk_size]
|
||||
xor edx,edx
|
||||
mul ecx
|
||||
shr eax,10+4 ;div 1024 ; div 16
|
||||
shl edx,18
|
||||
add eax,edx
|
||||
mov [ebp+RESULT_SLOT.write_speed],eax ; speed KB/s
|
||||
DEBUGF 1,'FSPEED: write chunk size: %s iterations: %d speed: %d KB/s\n',\
|
||||
[ebp+RESULT_SLOT.text],ecx,eax
|
||||
mcall 68,13,[filewrite.data]
|
||||
ret
|
||||
;-----------------------------------------------------------------------------
|
||||
include 'idata.inc'
|
||||
;-----------------------------------------------------------------------------
|
||||
IM_END:
|
||||
;-----------------------------------------------------------------------------
|
||||
include 'udata.inc'
|
||||
;-----------------------------------------------------------------------------
|
||||
I_END:
|
||||
;-----------------------------------------------------------------------------
|
313
programs/testing/fspeed/idata.inc
Normal file
313
programs/testing/fspeed/idata.inc
Normal file
@@ -0,0 +1,313 @@
|
||||
;-----------------------------------------------------------------------------
|
||||
s_text:
|
||||
if lang eq ru
|
||||
db '<27>롮<EFBFBD> 䠩<><E4A0A9>',0
|
||||
else
|
||||
db 'Select file',0
|
||||
end if
|
||||
;-----------------------------------------------------------------------------
|
||||
r_text:
|
||||
if lang eq ru
|
||||
db '<27><><EFBFBD><EFBFBD>',0
|
||||
else
|
||||
db 'Start',0
|
||||
end if
|
||||
;-----------------------------------------------------------------------------
|
||||
result_table_text:
|
||||
if lang eq ru
|
||||
db '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>⥭<EFBFBD><E2A5AD> (<28><>/<2F>) <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28><>/<2F>)',0
|
||||
else
|
||||
db 'Size Read (KB/s) Write (KB/s)',0
|
||||
end if
|
||||
;-----------------------------------------------------------------------------
|
||||
title db 'File Speed v0.3',0
|
||||
;-----------------------------------------------------------------------------
|
||||
include_debug_strings
|
||||
;-----------------------------------------------------------------------------
|
||||
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:
|
||||
;-----------------------------------------------------------------------------
|
||||
system_dir_Boxlib db '/sys/lib/box_lib.obj',0
|
||||
system_dir_ProcLib db '/sys/lib/proc_lib.obj',0
|
||||
|
||||
head_f_i:
|
||||
head_f_l db 'System error',0
|
||||
|
||||
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
|
||||
ProcLib_import:
|
||||
OpenDialog_Init dd aOpenDialog_Init
|
||||
OpenDialog_Start dd aOpenDialog_Start
|
||||
;OpenDialog_Version dd aOpenDialog_Version
|
||||
|
||||
;ColorDialog_Init dd aColorDialog_Init
|
||||
;ColorDialog_Start dd aColorDialog_Start
|
||||
;ColorDialog_Version dd aColorDialog_Version
|
||||
|
||||
dd 0
|
||||
dd 0
|
||||
|
||||
aOpenDialog_Init db 'OpenDialog_init',0
|
||||
aOpenDialog_Start db 'OpenDialog_start',0
|
||||
;aOpenDialog_Version db 'Version_OpenDialog',0
|
||||
|
||||
;aColorDialog_Init db 'ColorDialog_init',0
|
||||
;aColorDialog_Start db 'ColorDialog_start',0
|
||||
;aColorDialog_Version db 'Version_ColorDialog',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
|
||||
|
||||
init_checkbox dd aInit_checkbox
|
||||
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
|
||||
|
||||
;Frame_draw dd sz_Frame_draw
|
||||
;Version_frame dd szVersion_frame
|
||||
|
||||
dd 0
|
||||
dd 0
|
||||
|
||||
;a_init db 'lib_init',0
|
||||
;a_version db 'version',0
|
||||
|
||||
;aEdit_box_draw db 'edit_box',0
|
||||
;aEdit_box_key db 'edit_box_key',0
|
||||
;aEdit_box_mouse db 'edit_box_mouse',0
|
||||
;aVersion_ed db 'version_ed',0
|
||||
|
||||
aInit_checkbox db 'init_checkbox2',0
|
||||
aCheck_box_draw db 'check_box_draw2',0
|
||||
aCheck_box_mouse db 'check_box_mouse2',0
|
||||
;aVersion_ch db 'version_ch2',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
|
||||
|
||||
;sz_Frame_draw db 'frame_draw',0
|
||||
;szVersion_frame db 'version_frame',0
|
||||
;-----------------------------------------------------------------------------
|
||||
PathShow_data:
|
||||
.type dd 0 ;+0
|
||||
.start_y dw 5+4 ;+4
|
||||
.start_x dw 5+5 ;+6
|
||||
.font_size_x dw 6 ;+8 ; 6 - for font 0, 8 - for font 1
|
||||
.area_size_x dw 400-30 ;+10
|
||||
.font_number dd 0 ;+12 ; 0 - monospace, 1 - variable
|
||||
.background_flag dd 0 ;+16
|
||||
.font_color dd 0x0 ;+20
|
||||
.background_color dd 0x0 ;+24
|
||||
.text_pointer dd fname ;+28
|
||||
.work_area_pointer dd text_work_area ;+32
|
||||
.temp_text_length dd 0 ;+36
|
||||
;-----------------------------------------------------------------------------
|
||||
check1 check_box2 (100 shl 16)+12,(27 shl 16)+12,6,0xFFFFFF,0,0xffffff,\
|
||||
check_text1,ch_flag_middle
|
||||
|
||||
check_text1:
|
||||
if lang eq ru
|
||||
db '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E0AEA2><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',0
|
||||
else
|
||||
db 'Use testing of write',0
|
||||
end if
|
||||
|
||||
check_box_warning_text:
|
||||
if lang eq ru
|
||||
db '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>! <20><EFBFBD>ઠ <><E1AAAE><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 㭨<>⮦<EFBFBD><E2AEA6><EFBFBD> ᮤ<>ন<EFBFBD><E0A6A8><EFBFBD> 䠩<><E4A0A9>!',0
|
||||
else
|
||||
db 'WARNING! Testing of write speed is destroy contents of file!',0
|
||||
end if
|
||||
;-----------------------------------------------------------------------------
|
||||
OpenDialog_data:
|
||||
.type dd 0
|
||||
.procinfo dd process_info ;+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 ;+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_dialog2',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
|
||||
.1:
|
||||
;db 'BIN',0
|
||||
;db 'DAT',0
|
||||
.end:
|
||||
db 0
|
||||
|
||||
start_temp_file_name:
|
||||
db 'default.dtp',0
|
||||
|
||||
default_dtp:
|
||||
db '/sys/default.dtp',0
|
||||
;-----------------------------------------------------------------------------
|
||||
sector equ 512
|
||||
;--------------------------------------
|
||||
result_table:
|
||||
dd a512b, 0, 0, sector*1
|
||||
dd a1K, 1, 1, sector*2
|
||||
dd a2K, 2, 2, sector*4
|
||||
dd a4K, 3, 3, sector*8
|
||||
dd a8K, 4, 4, sector*16
|
||||
dd a16K, 5, 5, sector*32
|
||||
dd a32K, 6, 6, sector*64
|
||||
dd a64K, 7, 7, sector*128
|
||||
dd a128K, 8, 8, sector*256
|
||||
dd a256K, 9, 9, sector*512
|
||||
dd a512K, 10, 10, sector*1024
|
||||
dd a1M, 11, 11, sector*2*1024
|
||||
dd a2M, 12, 12, sector*4*1024
|
||||
dd a4M, 13, 13, sector*8*1024
|
||||
dd a8M, 14, 14, sector*16*1024
|
||||
dd a16M, 15, 15, sector*32*1024
|
||||
dd a32M, 16, 16, sector*64*1024
|
||||
dd a64M, 17, 17, sector*128*1024
|
||||
;-----------------------------------------------------------------------------
|
||||
a512b db ' 512',0
|
||||
a1K db ' 1K',0
|
||||
a2K db ' 2K',0
|
||||
a4K db ' 4K',0
|
||||
a8K db ' 8K',0
|
||||
a16K db ' 16K',0
|
||||
a32K db ' 32K',0
|
||||
a64K db ' 64K',0
|
||||
a128K db '128K',0
|
||||
a256K db '256K',0
|
||||
a512K db '512K',0
|
||||
a1M db ' 1M',0
|
||||
a2M db ' 2M',0
|
||||
a4M db ' 4M',0
|
||||
a8M db ' 8M',0
|
||||
a16M db ' 16M',0
|
||||
a32M db ' 32M',0
|
||||
a64M db ' 64M',0
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
fileinfo:
|
||||
.subfunction dd 5
|
||||
.offset dd 0
|
||||
.offset_1 dd 0
|
||||
.size dd 0
|
||||
.return dd file_info
|
||||
db 0
|
||||
.name: dd fname
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
fileread:
|
||||
.subfunction dd 0
|
||||
.offset dd 0
|
||||
.offset_1 dd 0
|
||||
.size dd 0
|
||||
.return dd process_info
|
||||
db 0
|
||||
.name: dd fname
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
filewrite:
|
||||
.subfunction dd 3
|
||||
.offset dd 0
|
||||
.offset_1 dd 0
|
||||
.size dd 0
|
||||
.data dd process_info
|
||||
db 0
|
||||
.name: dd fname
|
||||
;-----------------------------------------------------------------------------
|
43
programs/testing/fspeed/udata.inc
Normal file
43
programs/testing/fspeed/udata.inc
Normal file
@@ -0,0 +1,43 @@
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
cur_dir_path:
|
||||
rb 4096
|
||||
;-----------------------------------------------------------------------------
|
||||
library_path:
|
||||
rb 4096
|
||||
;-----------------------------------------------------------------------------
|
||||
temp_dir_pach:
|
||||
rb 4096
|
||||
;-----------------------------------------------------------------------------
|
||||
process_info:
|
||||
rb 1024
|
||||
;-----------------------------------------------------------------------------
|
||||
fname:
|
||||
rb 4096
|
||||
;-----------------------------------------------------------------------------
|
||||
filename_area:
|
||||
rb 256
|
||||
;-----------------------------------------------------------------------------
|
||||
text_work_area:
|
||||
rb 1024
|
||||
;-----------------------------------------------------------------------------
|
||||
file_info:
|
||||
rb 40
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
app_colours:
|
||||
w_frame dd ?
|
||||
w_grab dd ?
|
||||
w_work_dark dd ?
|
||||
w_work_light dd ?
|
||||
w_grab_text dd ?
|
||||
w_work dd ?
|
||||
w_work_button dd ?
|
||||
w_work_button_text dd ?
|
||||
w_work_text dd ?
|
||||
w_work_graph dd ?
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
rb 256
|
||||
STACK_TOP:
|
||||
;-----------------------------------------------------------------------------
|
3
programs/testing/kbd/trunk/Tupfile.lua
Normal file
3
programs/testing/kbd/trunk/Tupfile.lua
Normal file
@@ -0,0 +1,3 @@
|
||||
if tup.getconfig("NO_FASM") ~= "" then return end
|
||||
tup.rule("echo lang fix " .. ((tup.getconfig("LANG") == "") and "en" or tup.getconfig("LANG")) .. " > lang.inc", {"lang.inc"})
|
||||
tup.rule({"kbd.ASM", extra_inputs = {"lang.inc"}}, "fasm %f %o " .. tup.getconfig("KPACK_CMD"), "kbd")
|
2
programs/testing/kbd/trunk/build.bat
Normal file
2
programs/testing/kbd/trunk/build.bat
Normal file
@@ -0,0 +1,2 @@
|
||||
@fasm kbd.asm kbd
|
||||
@pause
|
594
programs/testing/kbd/trunk/kbd.ASM
Normal file
594
programs/testing/kbd/trunk/kbd.ASM
Normal file
@@ -0,0 +1,594 @@
|
||||
;
|
||||
; Kolibri Bus Disconnect
|
||||
; Test for bus disconnect
|
||||
;
|
||||
; Compile with FASM for Menuet
|
||||
;
|
||||
;
|
||||
|
||||
include '..\..\..\macros.inc'
|
||||
include 'lang.inc'
|
||||
|
||||
memsize = 1000h
|
||||
org 0
|
||||
PARAMS = memsize - 1024
|
||||
|
||||
appname equ 'Kolibri Bus Disconnect'
|
||||
version equ ' 1.1 '
|
||||
|
||||
use32 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 32-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ०<><E0A5A6> <20><>ᥬ<EFBFBD><E1A5AC><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
db 'MENUET01' ; 8 byte id
|
||||
dd 0x01 ; header version
|
||||
dd START ; start of code
|
||||
dd I_END ; size of image
|
||||
dd memsize ; memory for app
|
||||
dd memsize - 1024 ; esp
|
||||
dd PARAMS , 0x0 ; I_Param , I_Icon
|
||||
|
||||
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
;--- <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ----------------------------------------------
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
START:
|
||||
cmp [PARAMS], byte 0
|
||||
jne check_parameters
|
||||
|
||||
no_params:
|
||||
call find_north_bridg
|
||||
|
||||
drawwindow:
|
||||
mov eax,48
|
||||
mov ebx,3
|
||||
mov ecx,sc
|
||||
mov edx,sizeof.system_colors
|
||||
mcall
|
||||
|
||||
mov eax, 12
|
||||
mov ebx, 1 ; start redraw
|
||||
mcall
|
||||
|
||||
mov eax, 0 ; window
|
||||
mov ebx, 100 shl 16 + 300
|
||||
mov ecx, 100 shl 16 + 90
|
||||
mov edx, [sc.work]
|
||||
or edx, 0x13000000
|
||||
mov edi, title
|
||||
mcall
|
||||
|
||||
mov eax, 4
|
||||
mov ebx, 17 shl 16 + 30
|
||||
mov ecx, [sc.work_text]
|
||||
mov edx, msg_nb
|
||||
mov esi, msg_nb.length
|
||||
mcall
|
||||
|
||||
mov ebx, 105 shl 16 + 30
|
||||
mov edx, [nb_name]
|
||||
movzx esi, byte[edx]
|
||||
inc edx
|
||||
mcall
|
||||
|
||||
mov ebx, 17 shl 16 + 40
|
||||
mov edx, msg_stat
|
||||
mov esi, msg_stat.length
|
||||
mcall
|
||||
|
||||
mov ebx, 102 shl 16 + 50
|
||||
mov edx, msg_divs
|
||||
mov esi, msg_divs.length
|
||||
mcall
|
||||
mov ebx, 17 shl 16 + 62
|
||||
mov edx, msg_hdd
|
||||
mov esi, msg_hdd.length
|
||||
mcall
|
||||
mov ebx, 17 shl 16 + 72
|
||||
mov edx, msg_sgd
|
||||
mov esi, msg_sgd.length
|
||||
mcall
|
||||
|
||||
call get_divs
|
||||
mov eax, 47
|
||||
mov ebx, 0x30000
|
||||
mov ecx, [val_hdd]
|
||||
mov edx, 8
|
||||
shl edx, cl
|
||||
mov ecx, edx
|
||||
mov edx, 80 shl 16 + 62
|
||||
mov esi, [sc.work_text]
|
||||
mcall
|
||||
|
||||
mov ecx, [val_sgd]
|
||||
mov edx, 8
|
||||
shl edx, cl
|
||||
mov ecx, edx
|
||||
mov edx, 80 shl 16 + 72
|
||||
mcall
|
||||
|
||||
|
||||
call get_bd_stat
|
||||
mov ecx, [sc.work_text]
|
||||
mov esi, msg_nf.length
|
||||
mov ebx, 105 shl 16 + 40
|
||||
mov edx, msg_nf
|
||||
mov al, [bd_stat]
|
||||
test al, al
|
||||
jz @f
|
||||
mov edx, msg_dis
|
||||
dec al
|
||||
jz @f
|
||||
mov edx, msg_en
|
||||
mov esi, msg_en.length
|
||||
@@: mov eax, 4
|
||||
mcall
|
||||
|
||||
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
mov ecx, 27 shl 16 + 20
|
||||
mov eax, 8
|
||||
mov ebx, 220 shl 16 + 70
|
||||
mov esi, [sc.work_button]
|
||||
mov edx, 2
|
||||
mcall
|
||||
|
||||
; <20> <20><><EFBFBD> 14 ;)
|
||||
mov edi, 7
|
||||
mov ecx, 60 shl 16 + 10
|
||||
mov eax, 8
|
||||
mov ebx, 105 shl 16 + 25
|
||||
mov edx, 3
|
||||
|
||||
@@: mcall
|
||||
inc edx
|
||||
add ebx, 27 shl 16
|
||||
dec edi
|
||||
jnz @b
|
||||
|
||||
add ecx, 12 shl 16
|
||||
mov ebx, 105 shl 16 + 25
|
||||
mov edi, 7
|
||||
@@: mcall
|
||||
inc edx
|
||||
add ebx, 27 shl 16
|
||||
dec edi
|
||||
jnz @b
|
||||
|
||||
end_dr: mov eax, 12
|
||||
mov ebx, 2 ; end redraw
|
||||
mcall
|
||||
|
||||
; Wait for event ...
|
||||
mov eax, 10
|
||||
mcall
|
||||
|
||||
cmp al, 3
|
||||
jne not_bt
|
||||
|
||||
mov eax, 17 ; get id
|
||||
mcall
|
||||
cmp ah, 1
|
||||
jne no_exit
|
||||
mov eax, -1 ; close this program
|
||||
mcall
|
||||
no_exit:
|
||||
cmp ah, 2
|
||||
jne no_ch_bt
|
||||
mov dl, [bd_stat]
|
||||
test dl, dl
|
||||
jz drawwindow
|
||||
xor eax, eax
|
||||
dec dl
|
||||
jnz @f
|
||||
inc eax
|
||||
@@: call set_bd_stat
|
||||
jmp drawwindow
|
||||
|
||||
no_ch_bt:
|
||||
cmp ah, 9
|
||||
jg no_hdd_bt
|
||||
sub ah, 3
|
||||
movzx esi, ah
|
||||
mov edi, [val_sgd]
|
||||
call set_divs
|
||||
jmp drawwindow
|
||||
no_hdd_bt:
|
||||
sub ah, 10
|
||||
movzx edi, ah
|
||||
mov esi, [val_hdd]
|
||||
call set_divs
|
||||
jmp drawwindow
|
||||
|
||||
|
||||
not_bt: cmp al, 2
|
||||
jne drawwindow
|
||||
mov eax, 2 ; <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>ন<EFBFBD><E0A6A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <20><>⠥<EFBFBD> <20> <20><><EFBFBD>뢠<EFBFBD><EBA2A0>
|
||||
mcall
|
||||
jmp drawwindow
|
||||
;--------------------------------------------------------------------------
|
||||
bus_num: db 2 ; <20><><EFBFBD><EFBFBD><EFBFBD> 設<>
|
||||
devfn: db 255
|
||||
bd_id: dd 0 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䨪<EFBFBD><E4A8AA><EFBFBD><EFBFBD> <20><><EFBFBD>ன<EFBFBD>⢠
|
||||
bd_stat: db 0 ; 0 - <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, 1 - <20>몫<EFBFBD>祭, 2 - <20><><EFBFBD><EFBFBD>祭
|
||||
|
||||
nb_name dd nb_nf
|
||||
bd_msk dd msk_i440
|
||||
|
||||
if lang eq it
|
||||
;nb_nf db 9, 'Non trovato'
|
||||
nb_nf db 11, 'Non trovato'
|
||||
else
|
||||
nb_nf db 9, 'Not found'
|
||||
end if
|
||||
msk_i440 db 0
|
||||
nb_i440 db 4, 'i440'
|
||||
msk_nforce db 0x6D, 0x80, 0xE7, 0x06, 0 ; <20><><EFBFBD><EFBFBD><EFBFBD> ॣ<><E0A5A3><EFBFBD><EFBFBD><EFBFBD>, <20><>᪠, <20><><EFBFBD><EFBFBD><EFBFBD> ॣ<><E0A5A3><EFBFBD><EFBFBD><EFBFBD>, <20><>᪠, ... , 0
|
||||
nb_nforce db 6, 'nForce'
|
||||
msk_nforce2 db 0x6F, 0x10, 0
|
||||
nb_nforce2 db 8, 'nForce 2'
|
||||
msk_sis730 db 0x6B, 0x01, 0
|
||||
nb_sis730 db 7, 'SiS 730'
|
||||
nb_sis733 db 7, 'SiS 733'
|
||||
msk_sis735 db 0x6A, 0x03, 0
|
||||
nb_sis735 db 7, 'SiS 735'
|
||||
nb_sis740 db 7, 'SiS 740'
|
||||
nb_sis741 db 7, 'SiS 741'
|
||||
nb_sis745 db 7, 'SiS 745'
|
||||
msk_sis746 db 0x6C, 0x01, 0
|
||||
nb_sis746 db 7, 'SiS 746'
|
||||
nb_sis748 db 7, 'SiS 748'
|
||||
msk_amd751 db 0x62, 0x06, 0
|
||||
nb_amd751 db 7, 'AMD 751'
|
||||
nb_amd751s db 8, 'AMD 751S'
|
||||
nb_amd761 db 7, 'AMD 761'
|
||||
msk_amd762 db 0x62, 0x02, 0x6A, 0x02, 0
|
||||
nb_amd762 db 7, 'AMD 762'
|
||||
msk_viakt133 db 0x52, 0x80, 0x70, 0x08, 0
|
||||
nb_viakt133 db 30, 'VIA KT133(A)/KM133/KL133/KN133'
|
||||
nb_viakx133 db 9, 'VIA KX133'
|
||||
nb_viakle133 db 10, 'VIA KLE133'
|
||||
msk_viakt266 db 0x92, 0x80, 0x95, 0x02, 0x70, 0x08, 0
|
||||
nb_viakt266 db 18, 'VIA KT266(A)/KT333'
|
||||
nb_viakm266 db 21, 'VIA KM266/KL266/KM333'
|
||||
nb_viakn266 db 9, 'VIA KN266'
|
||||
msk_viakt400 db 0xD2, 0x80, 0xD5, 0x02, 0x70, 0x08, 0
|
||||
nb_viakt400 db 18, 'VIA KT400(A)/KT600'
|
||||
nb_viakm400 db 9, 'VIA KM400'
|
||||
msk_viakt880 db 0x82, 0x80, 0x85, 0x02, 0
|
||||
nb_viakt880 db 9, 'VIA KT880'
|
||||
|
||||
|
||||
bd_table: dd 0x70061022 ; AMD 751 ----
|
||||
dd nb_amd751
|
||||
dd msk_amd751
|
||||
|
||||
dd 0x70041022 ; AMD 751S
|
||||
dd nb_amd751s
|
||||
dd msk_amd751
|
||||
|
||||
dd 0x700E1022 ; AMD 761
|
||||
dd nb_amd761
|
||||
dd msk_amd751
|
||||
|
||||
dd 0x700C1022 ; AMD 762
|
||||
dd nb_amd762
|
||||
dd msk_amd762
|
||||
|
||||
dd 0x71908086 ; i440 ---
|
||||
dd nb_i440
|
||||
dd msk_i440
|
||||
|
||||
dd 0x01A410DE ; nForce ----
|
||||
dd nb_nforce
|
||||
dd msk_nforce
|
||||
|
||||
dd 0x01E010DE ; nForce 2
|
||||
dd nb_nforce2
|
||||
dd msk_nforce2
|
||||
|
||||
dd 0x07301039 ; SiS 730 ----
|
||||
dd nb_sis730
|
||||
dd msk_sis730
|
||||
|
||||
dd 0x07331039 ; SiS 733
|
||||
dd nb_sis733
|
||||
dd msk_sis730
|
||||
|
||||
dd 0x07351039 ; SiS 735
|
||||
dd nb_sis735
|
||||
dd msk_sis735
|
||||
|
||||
dd 0x07401039 ; SiS 740
|
||||
dd nb_sis740
|
||||
dd msk_sis735
|
||||
|
||||
dd 0x07411039 ; SiS 741
|
||||
dd nb_sis741
|
||||
dd msk_sis735
|
||||
|
||||
dd 0x07451039 ; SiS 745
|
||||
dd nb_sis745
|
||||
dd msk_sis735
|
||||
|
||||
dd 0x07461039 ; SiS 746
|
||||
dd nb_sis746
|
||||
dd msk_sis746
|
||||
|
||||
dd 0x07481039 ; SiS 748
|
||||
dd nb_sis748
|
||||
dd msk_sis746
|
||||
|
||||
dd 0x03051106 ; VIA KT133(A)/KM133/KL133/KN133 ----
|
||||
dd nb_viakt133
|
||||
dd msk_viakt133
|
||||
|
||||
dd 0x03911106 ; VIA KX133
|
||||
dd nb_viakx133
|
||||
dd msk_viakt133
|
||||
|
||||
dd 0x06911106 ; VIA KLE133
|
||||
dd nb_viakle133
|
||||
dd msk_viakt133
|
||||
|
||||
dd 0x30991106 ; VIA KT266(A)/KT333
|
||||
dd nb_viakt266
|
||||
dd msk_viakt266
|
||||
|
||||
dd 0x31161106 ; VIA KM266/KL266/KM333
|
||||
dd nb_viakm266
|
||||
dd msk_viakt266
|
||||
|
||||
dd 0x31561106 ; VIA KN266
|
||||
dd nb_viakn266
|
||||
dd msk_viakt266
|
||||
|
||||
dd 0x31891106 ; VIA KT400(A)/KT600
|
||||
dd nb_viakt400
|
||||
dd msk_viakt400
|
||||
|
||||
dd 0x32051106 ; VIA KM400
|
||||
dd nb_viakm400
|
||||
dd msk_viakt400
|
||||
|
||||
dd 0x22691106 ; VIA KT880
|
||||
dd nb_viakt880
|
||||
dd msk_viakt880
|
||||
bd_table_end:
|
||||
|
||||
|
||||
find_north_bridg:
|
||||
mov bl, 6
|
||||
xor cl, cl
|
||||
nbus: mov bh, [bus_num]
|
||||
ndevfn: mov ch, [devfn]
|
||||
mov eax, 62
|
||||
mcall
|
||||
cmp eax, 0xffffffff
|
||||
je bd_next
|
||||
;---------
|
||||
mov esi, bd_table_end - bd_table - 12
|
||||
@@: cmp eax, [bd_table + esi]
|
||||
je bd_found
|
||||
test esi, esi
|
||||
jz bd_next
|
||||
sub esi, 12
|
||||
jmp @b
|
||||
;---------
|
||||
bd_next:dec byte[devfn]
|
||||
jns ndevfn
|
||||
mov byte[devfn], 0
|
||||
dec byte[bus_num]
|
||||
jns nbus
|
||||
ret
|
||||
bd_found:
|
||||
add esi, bd_table + 4
|
||||
mov edi, nb_name
|
||||
mov ecx, 2
|
||||
rep movsd
|
||||
|
||||
mov [bd_id], eax
|
||||
ret
|
||||
|
||||
;----------------------
|
||||
;bd_stat: db 0 ; 0 - <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, 1 - <20>몫<EFBFBD>祭, 2 - <20><><EFBFBD><EFBFBD>祭
|
||||
get_bd_stat:
|
||||
mov byte[bd_stat], 1
|
||||
cld
|
||||
mov esi, [bd_msk]
|
||||
lodsw
|
||||
test al, al
|
||||
jnz @f
|
||||
mov byte[bd_stat], 0
|
||||
ret
|
||||
@@: push eax
|
||||
mov bh, [bus_num]
|
||||
mov bl, 4
|
||||
mov ch, [devfn]
|
||||
mov cl, al
|
||||
mov eax, 62
|
||||
mcall
|
||||
pop edx
|
||||
and al, dh
|
||||
jnz @f
|
||||
lodsw
|
||||
test al, al
|
||||
jnz @b
|
||||
ret
|
||||
@@: mov byte[bd_stat], 2
|
||||
ret
|
||||
;----------------------
|
||||
set_bd_stat:
|
||||
cmp dword[bd_id], 0x01E010DE ; ᯥ樠<E1AFA5>쭮 <20><><EFBFBD> nForce2 400
|
||||
je set_stat_nforce2
|
||||
|
||||
mov edi, eax
|
||||
cld
|
||||
mov esi, [bd_msk]
|
||||
bd_ss_nxt:
|
||||
lodsw
|
||||
test al, al
|
||||
jz bd_ss_end
|
||||
mov dl, ah ; <20><>᪠
|
||||
mov bh, [bus_num]
|
||||
mov bl, 4
|
||||
mov ch, [devfn]
|
||||
mov cl, al
|
||||
mov eax, 62
|
||||
mcall
|
||||
mov bl, 8
|
||||
test edi, edi
|
||||
jz @f
|
||||
or al, dl
|
||||
mov dl, al
|
||||
mov eax, 62
|
||||
mcall
|
||||
jmp bd_ss_nxt
|
||||
@@: not dl
|
||||
and al, dl
|
||||
mov dl, al
|
||||
mov eax, 62
|
||||
mcall
|
||||
jmp bd_ss_nxt
|
||||
bd_ss_end:
|
||||
ret
|
||||
;------- nForce 2 -----------
|
||||
set_stat_nforce2:
|
||||
; IN : eax = 0 - disable, !0 - enable
|
||||
push eax
|
||||
mov bh, [bus_num]
|
||||
mov bl, 4
|
||||
mov ch, [devfn]
|
||||
mov cl, 0x6f
|
||||
mov eax, 62
|
||||
mcall
|
||||
and al, 0x1F
|
||||
mov dl, al
|
||||
mov bl, 8
|
||||
mov eax, 62
|
||||
mcall
|
||||
pop eax
|
||||
test eax, eax
|
||||
jz @f
|
||||
or dl, 0x10
|
||||
mov eax, 62
|
||||
mcall
|
||||
ret
|
||||
@@: and dl, 0xef
|
||||
mov eax, 62
|
||||
mcall
|
||||
ret
|
||||
;--------------------------------------------------------------------------
|
||||
; x8 x16 x32 x64 x128 x256 x512
|
||||
div_hdd: db 0x23, 0x27, 0x2B, 0x2F, 0x63, 0x67, 0x6B ; Halt Disconnect Divisor
|
||||
div_sgd: db 0x12, 0x52, 0x92, 0xD2, 0x12, 0x52, 0x92 ; Stop Grand Divisor
|
||||
; low word of 0xC001001B MSR
|
||||
; HDD\SGD 8 16 32 64 128 256 512
|
||||
; 8 0x1223 0x5223 0x9223 0xD223 | 0x1223 0x5223 0x9223
|
||||
; 16 0x1227 |
|
||||
; 32 0x122B |
|
||||
; 64 0x122F | 0x522F
|
||||
; 128 0x1263 |
|
||||
; 256 0x1267 & bit 18 is clear | & bit 18 is set
|
||||
; 512 0x126B |
|
||||
; ^^^^
|
||||
; ||||_HDD
|
||||
; ||_SGD
|
||||
set_divs:
|
||||
; IN : ESI - hdd (0 = x8, 1 = x16 ..)
|
||||
; EDI - sgd (0 = x8, 1 = x16 ..)
|
||||
mov eax, 68
|
||||
mov ebx, 3
|
||||
mov edx, 0xC001001b
|
||||
mcall
|
||||
mov al, [div_hdd + esi]
|
||||
mov ah, [div_sgd + edi]
|
||||
and eax, 0xFFFBFFFF
|
||||
cmp edi, 3
|
||||
jle @f
|
||||
or eax, 0x40000
|
||||
@@: mov edi, eax
|
||||
mov esi, ebx
|
||||
mov eax, 68
|
||||
mov ebx, 4
|
||||
mcall
|
||||
ret
|
||||
|
||||
get_divs:
|
||||
; OUT : val_hdd - hdd (0 = x8, 1 = x16 ..)
|
||||
; val_sgd - sgd ...
|
||||
mov eax, 68
|
||||
mov ebx, 3
|
||||
mov edx, 0xC001001b
|
||||
mcall
|
||||
mov ecx, 7
|
||||
@@: cmp [div_hdd + ecx - 1], al
|
||||
je @f
|
||||
loop @b
|
||||
@@: dec ecx
|
||||
mov [val_hdd], ecx
|
||||
mov ecx, 4
|
||||
@@: cmp [div_sgd + ecx - 1], ah
|
||||
je @f
|
||||
loop @b
|
||||
@@: dec ecx
|
||||
test eax, 0x40000
|
||||
jz @f
|
||||
add ecx, 4
|
||||
@@: mov [val_sgd], ecx
|
||||
ret
|
||||
|
||||
;******************************************************************************
|
||||
|
||||
check_parameters:
|
||||
cmp [PARAMS], dword "BOOT" ; received BOOT parameter -> goto handler
|
||||
je boot_bd_enable
|
||||
jmp no_params
|
||||
|
||||
;******************************************************************************
|
||||
|
||||
boot_bd_enable:
|
||||
|
||||
call find_north_bridg
|
||||
call set_bd_stat
|
||||
mcall -1
|
||||
|
||||
;******************************************************************************
|
||||
|
||||
|
||||
;--------------------------------------------------------------------------
|
||||
|
||||
title db appname,version,0
|
||||
|
||||
msg_divs db ' x8 x16 x32 x64 x128 x256 x512'
|
||||
.length = $ - msg_divs
|
||||
msg_hdd db 'Hatl Disc.'
|
||||
.length = $ - msg_hdd
|
||||
msg_sgd db 'Stop Grand'
|
||||
.length = $ - msg_sgd
|
||||
msg_nb db 'North bridge :'
|
||||
.length = $ - msg_nb
|
||||
msg_stat db 'Status :'
|
||||
.length = $ - msg_stat
|
||||
|
||||
if lang eq it
|
||||
msg_en db 'Abilitato '
|
||||
.length = $ - msg_en
|
||||
msg_dis db 'Disabilitato'
|
||||
.length = $ - msg_dis
|
||||
msg_nf db 'Non trovato '
|
||||
.length = $ - msg_nf
|
||||
else
|
||||
msg_en db 'Enabled '
|
||||
.length = $ - msg_en
|
||||
msg_dis db 'Disabled '
|
||||
.length = $ - msg_dis
|
||||
msg_nf db 'Not found'
|
||||
.length = $ - msg_nf
|
||||
end if
|
||||
|
||||
I_END:
|
||||
|
||||
sc system_colors
|
||||
val_hdd dd ?
|
||||
val_sgd dd ?
|
||||
|
18
programs/testing/kbd/trunk/makefile
Normal file
18
programs/testing/kbd/trunk/makefile
Normal file
@@ -0,0 +1,18 @@
|
||||
#!gmake
|
||||
|
||||
FASM=/opt/bin/fasm
|
||||
KPACK=/opt/bin/kpack
|
||||
LANG=lang.inc
|
||||
FILE=kbd
|
||||
SOURCE=${FILE}.ASM
|
||||
OUT=${FILE}.bin
|
||||
|
||||
en:
|
||||
echo "lang fix en" > ${LANG}
|
||||
${FASM} ${SOURCE} ${OUT}
|
||||
it:
|
||||
echo "lang fix it" > ${LANG}
|
||||
${FASM} ${SOURCE} ${OUT}
|
||||
|
||||
clean:
|
||||
rm -f ${LANG} ${OUT}
|
45
programs/testing/kbd/trunk/readme.txt
Normal file
45
programs/testing/kbd/trunk/readme.txt
Normal file
@@ -0,0 +1,45 @@
|
||||
Kolibri Bus Disconnect
|
||||
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> : <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> aka Ghost
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> : <20><> 24/10/06
|
||||
<EFBFBD><EFBFBD> : Kolibri
|
||||
forum : meos.sysbin.com -> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> -> GMon
|
||||
mailto : ghost.nsk@mail.ru
|
||||
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
|
||||
|
||||
AMD 751
|
||||
AMD 751S
|
||||
AMD 761
|
||||
AMD 762
|
||||
|
||||
NVIDIA nForce
|
||||
NVIDIA nForce 2 (400)
|
||||
|
||||
SiS 735
|
||||
SiS 740
|
||||
SiS 741
|
||||
SiS 745
|
||||
SiS 730
|
||||
SiS 733
|
||||
SiS 746
|
||||
SiS 748
|
||||
|
||||
VIA KT133(A)/KM133/KL133/KN133 *
|
||||
VIA KX133
|
||||
VIA KLE133
|
||||
VIA KT266(A)/KT333
|
||||
VIA KM266/KL266/KM333
|
||||
VIA KN266
|
||||
VIA KT400(A)/KT600
|
||||
VIA KM400
|
||||
VIA KT880
|
||||
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: (Heavyiron, 24.10.2006)
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> (<28><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> boot. <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20>
|
||||
autorun.dat <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
|
||||
"/RD/1/KBD BOOT 20 # Enable Bus Disconnect for AMD K7 processors",
|
||||
<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD>
|
||||
<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> autorun.dat.
|
||||
|
3
programs/testing/mgb/trunk/Tupfile.lua
Normal file
3
programs/testing/mgb/trunk/Tupfile.lua
Normal file
@@ -0,0 +1,3 @@
|
||||
if tup.getconfig("NO_FASM") ~= "" then return end
|
||||
tup.rule("echo lang fix " .. ((tup.getconfig("LANG") == "") and "en" or tup.getconfig("LANG")) .. " > lang.inc", {"lang.inc"})
|
||||
tup.rule({"mgb.asm", extra_inputs = {"lang.inc"}}, "fasm %f %o " .. tup.getconfig("KPACK_CMD"), "mgb")
|
6
programs/testing/mgb/trunk/build.bat
Normal file
6
programs/testing/mgb/trunk/build.bat
Normal file
@@ -0,0 +1,6 @@
|
||||
@erase lang.inc
|
||||
@echo lang fix en >lang.inc
|
||||
@fasm -m 16384 mgb.asm mgb
|
||||
@kpack mgb
|
||||
@erase lang.inc
|
||||
@pause
|
13
programs/testing/mgb/trunk/build.sh
Executable file
13
programs/testing/mgb/trunk/build.sh
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
# This script does for linux the same as build.bat for DOS,
|
||||
# it compiles the KoOS kernel, hopefully ;-)
|
||||
|
||||
echo "lang fix en"
|
||||
echo "lang fix en" > lang.inc
|
||||
fasm -m 16384 mgb.asm mgb
|
||||
rm -f lang.inc
|
||||
exit 0
|
||||
|
||||
|
||||
|
||||
|
19
programs/testing/mgb/trunk/makefile
Normal file
19
programs/testing/mgb/trunk/makefile
Normal file
@@ -0,0 +1,19 @@
|
||||
#!gmake
|
||||
|
||||
# Macro
|
||||
FASM=/opt/bin/fasm
|
||||
KPACK=/opt/bin/kpack
|
||||
LANG=lang.inc
|
||||
FILE=mgb
|
||||
SOURCE=${FILE}.asm
|
||||
OUT=${FILE}.bin
|
||||
|
||||
en:
|
||||
echo "lang fix en" > ${LANG}
|
||||
${FASM} ${SOURCE} ${OUT}
|
||||
it:
|
||||
echo "lang fix it" > ${LANG}
|
||||
${FASM} ${SOURCE} ${OUT}
|
||||
|
||||
clean:
|
||||
rm -f ${LANG} ${OUT}
|
1203
programs/testing/mgb/trunk/mgb.asm
Normal file
1203
programs/testing/mgb/trunk/mgb.asm
Normal file
File diff suppressed because it is too large
Load Diff
3
programs/testing/protection/trunk/Tupfile.lua
Normal file
3
programs/testing/protection/trunk/Tupfile.lua
Normal file
@@ -0,0 +1,3 @@
|
||||
if tup.getconfig("NO_FASM") ~= "" then return end
|
||||
tup.rule("echo lang fix " .. ((tup.getconfig("LANG") == "") and "en" or tup.getconfig("LANG")) .. " > lang.inc", {"lang.inc"})
|
||||
tup.rule({"test.asm", extra_inputs = {"lang.inc"}}, "fasm %f %o " .. tup.getconfig("KPACK_CMD"), "test")
|
6
programs/testing/protection/trunk/build_en.bat
Normal file
6
programs/testing/protection/trunk/build_en.bat
Normal file
@@ -0,0 +1,6 @@
|
||||
@erase lang.inc
|
||||
@echo lang fix en >lang.inc
|
||||
@fasm -m 16384 test.asm test
|
||||
@kpack test
|
||||
@erase lang.inc
|
||||
@pause
|
6
programs/testing/protection/trunk/build_ru.bat
Normal file
6
programs/testing/protection/trunk/build_ru.bat
Normal file
@@ -0,0 +1,6 @@
|
||||
@erase lang.inc
|
||||
@echo lang fix ru >lang.inc
|
||||
@fasm -m 16384 test.asm test
|
||||
@kpack test
|
||||
@erase lang.inc
|
||||
@pause
|
18
programs/testing/protection/trunk/makefile
Normal file
18
programs/testing/protection/trunk/makefile
Normal file
@@ -0,0 +1,18 @@
|
||||
#!gmake
|
||||
# Macro
|
||||
FASM=/opt/bin/fasm
|
||||
KPACK=/opt/bin/kpack
|
||||
LANG=lang.inc
|
||||
FILE=test
|
||||
SOURCE=${FILE}.asm
|
||||
OUT=${FILE}.bin
|
||||
|
||||
en:
|
||||
echo "lang fix en" > ${LANG}
|
||||
${FASM} ${SOURCE} ${OUT}
|
||||
it:
|
||||
echo "lang fix it" > ${LANG}
|
||||
${FASM} ${SOURCE} ${OUT}
|
||||
|
||||
clean:
|
||||
rm -f ${LANG} ${OUT}
|
205
programs/testing/protection/trunk/test.asm
Normal file
205
programs/testing/protection/trunk/test.asm
Normal file
@@ -0,0 +1,205 @@
|
||||
;-------------------------------------------------------------------------------
|
||||
;
|
||||
; 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
|
||||
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
|
||||
text:
|
||||
db '<27>ਫ<EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0x1000 <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
||||
db ' '
|
||||
db '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> BOARD <20><><EFBFBD> <20><><EFBFBD>ᬮ<EFBFBD><E1ACAE><EFBFBD> १<><E0A5A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
||||
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
|
||||
tlabel:
|
||||
db 'Kolibri prova di protezione',0
|
||||
else if lang eq ru
|
||||
tlabel:
|
||||
db 'Kolibri <20><EFBFBD>ઠ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>',0
|
||||
else
|
||||
tlabel:
|
||||
db 'Kolibri protection test',0
|
||||
end if
|
||||
;-------------------------------------------------------------------------------
|
||||
I_END:
|
||||
;-------------------------------------------------------------------------------
|
||||
align 4
|
||||
rb 256
|
||||
stack_top:
|
||||
;-------------------------------------------------------------------------------
|
||||
IM_END:
|
||||
;-------------------------------------------------------------------------------
|
Reference in New Issue
Block a user