forked from KolibriOS/kolibrios
programs/develop: Post-SVN tidy (part 2) (#422)
- Move source code from `trunk` into root directory for each program. - Update build files and ASM include paths. Add SPDX license header where appropriate. - Note: Line endings standardised from `CRLF` > `LF`, so best to view diffs with whitespace changes hidden. (Work towards #75, point 3) Reviewed-on: KolibriOS/kolibrios#422 Reviewed-by: Mikhail Frolov <mixa.frolov2003@gmail.com> Reviewed-by: Burer <burer@noreply.localhost> Co-authored-by: Andrew <dent.ace@gmail.com> Co-committed-by: Andrew <dent.ace@gmail.com>
This commit is contained in:
1 parent
48626298ff
commit
6ad8a8b6cc
104 files changed
+1154
-1125
No files matched your search
+5
-5
@@ -445,7 +445,7 @@ tup.append_table(img_files, {
|
||||
{"SKINCFG", VAR_PROGS .. "/system/skincfg/skincfg"},
|
||||
{"TERMINAL", VAR_PROGS .. "/system/terminal/terminal"},
|
||||
{"TEST", VAR_PROGS .. "/testing/protection/trunk/test"},
|
||||
{"TINYPAD", VAR_PROGS .. "/develop/tinypad/trunk/tinypad"},
|
||||
{"TINYPAD", VAR_PROGS .. "/develop/tinypad/tinypad"},
|
||||
{"TINFO", VAR_PROGS .. "/system/tinfo/tinfo"},
|
||||
{"TIMER", VAR_PROGS .. "/other/Timer/Timer"},
|
||||
{"UNZ", VAR_PROGS .. "/fs/unz/unz"},
|
||||
@@ -473,16 +473,16 @@ tup.append_table(img_files, {
|
||||
{"DEVELOP/BOARD", VAR_PROGS .. "/system/board/board"},
|
||||
{"DEVELOP/DBGBOARD", VAR_PROGS .. "/system/dbgboard/dbgboard"},
|
||||
{"DEVELOP/CHARSETS", VAR_PROGS .. "/develop/charsets/charsets"},
|
||||
{"DEVELOP/COBJ", VAR_PROGS .. "/develop/cObj/trunk/cObj"},
|
||||
{"DEVELOP/COBJ", VAR_PROGS .. "/develop/cObj/cObj"},
|
||||
{"DEVELOP/ENTROPYV", VAR_PROGS .. "/develop/entropyview/entropyview"},
|
||||
{"DEVELOP/FASM", VAR_PROGS .. "/develop/fasm/1.73/fasm"},
|
||||
{"DEVELOP/GENFILES", VAR_PROGS .. "/testing/genfiles/GenFiles"},
|
||||
{"DEVELOP/PIPET", VAR_PROGS .. "/other/pipet/pipet"},
|
||||
{"DEVELOP/H2D2B", VAR_PROGS .. "/develop/h2d2b/trunk/h2d2b"},
|
||||
{"DEVELOP/HEED", VAR_PROGS .. "/develop/heed/trunk/heed"},
|
||||
{"DEVELOP/H2D2B", VAR_PROGS .. "/develop/h2d2b/h2d2b"},
|
||||
{"DEVELOP/HEED", VAR_PROGS .. "/develop/heed/heed"},
|
||||
{"DEVELOP/MTDBG", VAR_PROGS .. "/develop/mtdbg/mtdbg"},
|
||||
{"DEVELOP/MSTATE", VAR_PROGS .. "/develop/mstate/mstate"},
|
||||
{"DEVELOP/SCANCODE", VAR_PROGS .. "/develop/scancode/trunk/scancode"},
|
||||
{"DEVELOP/SCANCODE", VAR_PROGS .. "/develop/scancode/scancode"},
|
||||
{"DEVELOP/EXAMPLES/CIRCLE", VAR_PROGS .. "/develop/examples/circle/circle"},
|
||||
{"DEVELOP/EXAMPLES/COLORREF", VAR_PROGS .. "/demos/colorref/colorref"},
|
||||
{"DEVELOP/EXAMPLES/CONGET", VAR_PROGS .. "/develop/libraries/console_coff/examples/test_gets"},
|
||||
|
||||
+10
-10
@@ -86,17 +86,17 @@ fasm system\zkey\zkey.asm %BIN%\zkey
|
||||
echo *
|
||||
echo Building develop
|
||||
echo *
|
||||
fasm develop\cmd\trunk\cmd.asm %BIN%\cmd
|
||||
fasm develop\fasm\trunk\fasm.asm %BIN%\develop\fasm
|
||||
fasm develop\h2d2b\trunk\h2d2b.asm %BIN%\develop\h2d2b
|
||||
fasm develop\heed\trunk\heed.asm %BIN%\demos\heed
|
||||
rem fasm develop\cmd\trunk\cmd.asm %BIN%\cmd
|
||||
fasm develop\fasm\1.73\fasm.asm %BIN%\develop\fasm
|
||||
fasm develop\h2d2b\h2d2b.asm %BIN%\develop\h2d2b
|
||||
fasm develop\heed\heed.asm %BIN%\demos\heed
|
||||
rem fasm develop\hexview\trunk\hexview.asm hexview
|
||||
fasm develop\keyascii\trunk\keyascii.asm %BIN%\develop\keyascii
|
||||
fasm develop\keyascii\keyascii.asm %BIN%\develop\keyascii
|
||||
fasm develop\mtdbg\mtdbg.asm %BIN%\develop\mtdbg
|
||||
rem fasm develop\param\trunk\param.asm param
|
||||
fasm develop\scancode\trunk\scancode.asm %BIN%\develop\scancode
|
||||
fasm develop\tinypad\trunk\tinypad.asm %BIN%\tinypad
|
||||
fasm develop\cObj\trunk\cObj.asm %BIN%\develop\cObj
|
||||
fasm develop\scancode\scancode.asm %BIN%\develop\scancode
|
||||
fasm develop\tinypad\tinypad.asm %BIN%\tinypad
|
||||
fasm develop\cObj\cObj.asm %BIN%\develop\cObj
|
||||
|
||||
echo *
|
||||
echo Building systems libraries
|
||||
@@ -234,8 +234,8 @@ fasm media\kiv\kiv.asm %BIN%\nightbuild\kiv
|
||||
fasm media\scrshoot\scrshoot.asm %BIN%\nightbuild\scrshoot
|
||||
fasm media\animage\animage.asm %BIN%\nightbuild\animage
|
||||
fasm media\midamp\midamp.asm %BIN%\nightbuild\midamp
|
||||
fasm develop\heed\trunk\heed.asm %BIN%\nightbuild\heed
|
||||
fasm develop\tinypad\trunk\tinypad.asm %BIN%\nightbuild\tinypad
|
||||
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
|
||||
|
||||
File renamed without changes.
+329
-325
@@ -1,325 +1,329 @@
|
||||
use32
|
||||
org 0x0
|
||||
db 'MENUET01'
|
||||
dd 0x01,start,i_end,e_end,e_end,0,0
|
||||
|
||||
include '../../../proc32.inc'
|
||||
include '../../../macros.inc'
|
||||
|
||||
BUTTON_SIDE = 28 ; button are squares
|
||||
BUTTON_SPACE = 34 ; space between cols and rows
|
||||
BUTTON_ID_SHIFT = 2 ; button_id = character + BUTTON_ID_SHIFT
|
||||
TABLE_BEGIN_X = 2
|
||||
TABLE_BEGIN_Y = 2
|
||||
PANEL_Y = BUTTON_SPACE*8+TABLE_BEGIN_Y+TABLE_BEGIN_Y
|
||||
|
||||
FOCUS_SQUARE_COLOR = 0x000080FF
|
||||
SWITCHER_BLINK_COLOR = 0x00808080
|
||||
|
||||
FONT_SMALL = 0x01000000
|
||||
FONT_BIG = 0x10000000
|
||||
|
||||
|
||||
start:
|
||||
still:
|
||||
mcall 10
|
||||
dec eax
|
||||
jz redraw
|
||||
dec eax
|
||||
jz key
|
||||
|
||||
button:
|
||||
mcall 17
|
||||
shr eax, 8
|
||||
|
||||
cmp eax, 1
|
||||
je quit
|
||||
cmp ax, 0xFFAA ; page switcher
|
||||
je .switch_page ; any button with a character
|
||||
cmp ax, 0xEEBB ; page switcher
|
||||
je .switch_font
|
||||
.change_focus:
|
||||
mov bl, [symbol_focused]
|
||||
mov [symbol_unfocused], bl
|
||||
sub ax, BUTTON_ID_SHIFT ; get the corresponding character
|
||||
mov [symbol_focused], al
|
||||
stdcall draw_table, 0
|
||||
call draw_codes
|
||||
jmp still
|
||||
.switch_font:
|
||||
cmp [font_type], FONT_SMALL
|
||||
jne @f
|
||||
mov [font_type], FONT_BIG
|
||||
jmp redraw
|
||||
@@: mov [font_type], FONT_SMALL
|
||||
jmp redraw
|
||||
.switch_page:
|
||||
movzx bx, [symbol_start]
|
||||
add bx, BUTTON_ID_SHIFT
|
||||
mov cx, 128 ; half of page
|
||||
mov edx, 0x80000000
|
||||
mov dx, bx
|
||||
@@: mcall 8
|
||||
inc edx
|
||||
dec cx
|
||||
jnz @b
|
||||
|
||||
@@: add [symbol_start], 128 ; change page
|
||||
add [symbol_focused], 128
|
||||
stdcall draw_table, 1 ; 1 means redraw the whole table
|
||||
call draw_codes
|
||||
stdcall draw_page_switcher, 1 ; 1 means dark color, for blinking
|
||||
mcall 5, 10
|
||||
stdcall draw_page_switcher, 0 ; 0 means usual light color
|
||||
jmp still
|
||||
|
||||
redraw:
|
||||
mcall 9, proc_info, -1
|
||||
|
||||
mcall 12, 1
|
||||
|
||||
mcall 48, 4 ; get skin height
|
||||
mov ecx, 200*0x10000+PANEL_Y+33
|
||||
add ecx, eax
|
||||
mov ebx, 200*0x10000+BUTTON_SPACE*16+TABLE_BEGIN_X+TABLE_BEGIN_X+9
|
||||
mcall 0, , , 0x34AAAaaa, 0x80000000, window_title
|
||||
test [proc_info.wnd_state], 0x04
|
||||
jnz @f
|
||||
|
||||
stdcall draw_table, 1
|
||||
call draw_codes
|
||||
stdcall draw_page_switcher, 0
|
||||
stdcall draw_font_switcher
|
||||
|
||||
@@:
|
||||
mcall 12, 2
|
||||
jmp still
|
||||
|
||||
key:
|
||||
mcall 2
|
||||
cmp ah, 0x09 ; TAB key
|
||||
je button.switch_page
|
||||
|
||||
cmp ah, 0xB0 ; left
|
||||
jne @f
|
||||
mov bl, [symbol_focused]
|
||||
mov [symbol_unfocused], bl
|
||||
dec bl
|
||||
and bl, 0x0f
|
||||
and [symbol_focused], 0xf0
|
||||
or [symbol_focused], bl
|
||||
stdcall draw_table, 0
|
||||
call draw_codes
|
||||
jmp still
|
||||
|
||||
@@: cmp ah, 0xB1 ; down
|
||||
jne @f
|
||||
mov bl, [symbol_focused]
|
||||
mov [symbol_unfocused], bl
|
||||
add bl, 16
|
||||
and bl, 0x70
|
||||
and [symbol_focused], 0x8f
|
||||
or [symbol_focused], bl
|
||||
stdcall draw_table, 0
|
||||
call draw_codes
|
||||
jmp still
|
||||
|
||||
@@: cmp ah, 0xB2 ; up
|
||||
jne @f
|
||||
mov bl, [symbol_focused]
|
||||
mov [symbol_unfocused], bl
|
||||
sub bl, 16
|
||||
and bl, 0x70
|
||||
and [symbol_focused], 0x8f
|
||||
or [symbol_focused], bl
|
||||
stdcall draw_table, 0
|
||||
call draw_codes
|
||||
jmp still
|
||||
|
||||
@@: cmp ah, 0xB3 ; righ
|
||||
jne @f
|
||||
mov bl, [symbol_focused]
|
||||
mov [symbol_unfocused], bl
|
||||
inc bl
|
||||
and bl, 0x0f
|
||||
and [symbol_focused], 0xf0
|
||||
or [symbol_focused], bl
|
||||
stdcall draw_table, 0
|
||||
call draw_codes
|
||||
jmp still
|
||||
jne @f
|
||||
|
||||
@@:
|
||||
jmp still
|
||||
|
||||
|
||||
|
||||
proc draw_table _full_redraw
|
||||
|
||||
mov al, [symbol_start]
|
||||
mov [symbol_current], al
|
||||
|
||||
.next_button:
|
||||
|
||||
xor edi, edi ; character focus flag
|
||||
mov al, [symbol_current]
|
||||
cmp al, [symbol_focused]
|
||||
jne @f
|
||||
inc edi
|
||||
@@: cmp [_full_redraw], 1
|
||||
je .draw
|
||||
cmp al, [symbol_focused]
|
||||
je .draw
|
||||
cmp al, [symbol_unfocused] ; previously focused, should redraw to clear focus
|
||||
je .draw
|
||||
jmp .skip ; skip button if it isn't (un)focused
|
||||
|
||||
.draw:
|
||||
call draw_button
|
||||
.skip:
|
||||
mov bl, [symbol_start]
|
||||
add bl, 127 ; end of current page
|
||||
cmp [symbol_current], bl ; the last on page?
|
||||
jne @f
|
||||
mov [button_x], TABLE_BEGIN_X
|
||||
mov [button_y], TABLE_BEGIN_Y
|
||||
ret
|
||||
@@: inc [symbol_current]
|
||||
add [button_x], BUTTON_SPACE
|
||||
cmp [button_x], BUTTON_SPACE*16+TABLE_BEGIN_X ; the last in row?
|
||||
jne .next_button
|
||||
add [button_y], BUTTON_SPACE ; next row
|
||||
mov [button_x], TABLE_BEGIN_X
|
||||
jmp .next_button
|
||||
ret
|
||||
endp
|
||||
|
||||
|
||||
proc draw_button
|
||||
mov edx, 0x80000000
|
||||
mov dl, [symbol_current]
|
||||
add edx, BUTTON_ID_SHIFT
|
||||
mov esi, 0xFFFfff
|
||||
mcall 8, <[button_x],BUTTON_SIDE>, <[button_y],BUTTON_SIDE>
|
||||
and edx, 0x7FFFFFFF
|
||||
or edx, 0x20000000
|
||||
mcall
|
||||
|
||||
test edi, edi ; is focused?
|
||||
jz .symbol ; draw only character, not selection square
|
||||
.focus_frame: ; draw a blue square (selection), 8 segments
|
||||
mov esi, [button_x]
|
||||
mov edi, [button_y]
|
||||
|
||||
mov bx, si
|
||||
shl ebx, 16
|
||||
mov bx, si
|
||||
add bx, BUTTON_SIDE
|
||||
mov cx, di
|
||||
shl ecx, 16
|
||||
mov cx, di
|
||||
mcall 38, , , FOCUS_SQUARE_COLOR
|
||||
add ecx, 0x00010001
|
||||
mcall
|
||||
add ecx, (BUTTON_SIDE-2)*0x10000+(BUTTON_SIDE-2)
|
||||
mcall
|
||||
add ecx, 0x00010001
|
||||
mcall
|
||||
|
||||
mov bx, si
|
||||
shl ebx, 16
|
||||
mov bx, si
|
||||
mov cx, di
|
||||
shl ecx, 16
|
||||
mov cx, di
|
||||
add ecx, 2*0x10000+(BUTTON_SIDE-2)
|
||||
mcall 38, , ,
|
||||
add ebx, 0x00010001
|
||||
mcall
|
||||
add ebx, (BUTTON_SIDE-2)*0x10000+(BUTTON_SIDE-2)
|
||||
mcall
|
||||
add ebx, 0x00010001
|
||||
mcall
|
||||
|
||||
.symbol:
|
||||
mov ebx, [button_x]
|
||||
add ebx, 9
|
||||
shl ebx, 16
|
||||
add ebx, [button_y]
|
||||
add ebx, 7
|
||||
mov ecx, [font_type]
|
||||
mcall 4, , , symbol_current, 1
|
||||
|
||||
ret
|
||||
endp
|
||||
|
||||
|
||||
proc draw_page_switcher _blinking
|
||||
|
||||
mcall 8, , , 0x8000FFAA
|
||||
mov esi, 0xCCCccc
|
||||
cmp [_blinking], 1 ; blinking?
|
||||
jne @f
|
||||
mov esi, SWITCHER_BLINK_COLOR
|
||||
@@: mcall , <2,98>, <PANEL_Y+1,23>, 0x0000FFAA
|
||||
|
||||
mov ecx, 0x81000000
|
||||
mov edx, string_000_127
|
||||
cmp [symbol_start], 0 ; first page?
|
||||
je @f
|
||||
mov edx, string_128_255 ; ok, the second one
|
||||
@@: mcall 4, <10,PANEL_Y+6>,
|
||||
mcall , <278,PANEL_Y+6>, 0x81000000, string_ASCII_CODE
|
||||
|
||||
ret
|
||||
endp
|
||||
|
||||
proc draw_font_switcher
|
||||
|
||||
mcall 8, <120,136>, <PANEL_Y+1,23>, 0x0000EEBB
|
||||
|
||||
mov edx, string_font_small
|
||||
cmp [font_type], FONT_SMALL
|
||||
je @f
|
||||
mov edx, string_font_big
|
||||
@@: mcall 4, <130,PANEL_Y+6>,,,10
|
||||
|
||||
ret
|
||||
endp
|
||||
|
||||
|
||||
proc draw_codes
|
||||
|
||||
movzx ecx, [symbol_focused]
|
||||
mcall 47, 0x00030000, , <339,PANEL_Y+6>, 0x41000000, 0xAAAaaa
|
||||
mcall , 0x00020100, , <508,PANEL_Y+6>,
|
||||
|
||||
ret
|
||||
endp
|
||||
|
||||
|
||||
quit:
|
||||
mcall -1
|
||||
|
||||
|
||||
szZ window_title ,'ASCIIVju'
|
||||
szZ string_000_127 ,'000-127'
|
||||
szZ string_128_255 ,'128-255'
|
||||
szZ string_font_small ,'Font1 6x9 '
|
||||
szZ string_font_big ,'Font2 8x14'
|
||||
szZ string_ASCII_CODE ,'Code: Hex-Code:'
|
||||
|
||||
button_x dd 2
|
||||
button_y dd 2
|
||||
|
||||
font_type dd FONT_SMALL
|
||||
|
||||
symbol_current db 0
|
||||
symbol_start db 0
|
||||
|
||||
symbol_unfocused db 0
|
||||
symbol_focused db 0
|
||||
i_end:
|
||||
proc_info process_information
|
||||
rb 0x400 ;stack
|
||||
e_end:
|
||||
; SPDX-License-Identifier: NOASSERTION
|
||||
;
|
||||
|
||||
|
||||
use32
|
||||
org 0x0
|
||||
db 'MENUET01'
|
||||
dd 0x01,start,i_end,e_end,e_end,0,0
|
||||
|
||||
include '../../proc32.inc'
|
||||
include '../../macros.inc'
|
||||
|
||||
BUTTON_SIDE = 28 ; button are squares
|
||||
BUTTON_SPACE = 34 ; space between cols and rows
|
||||
BUTTON_ID_SHIFT = 2 ; button_id = character + BUTTON_ID_SHIFT
|
||||
TABLE_BEGIN_X = 2
|
||||
TABLE_BEGIN_Y = 2
|
||||
PANEL_Y = BUTTON_SPACE*8+TABLE_BEGIN_Y+TABLE_BEGIN_Y
|
||||
|
||||
FOCUS_SQUARE_COLOR = 0x000080FF
|
||||
SWITCHER_BLINK_COLOR = 0x00808080
|
||||
|
||||
FONT_SMALL = 0x01000000
|
||||
FONT_BIG = 0x10000000
|
||||
|
||||
|
||||
start:
|
||||
still:
|
||||
mcall 10
|
||||
dec eax
|
||||
jz redraw
|
||||
dec eax
|
||||
jz key
|
||||
|
||||
button:
|
||||
mcall 17
|
||||
shr eax, 8
|
||||
|
||||
cmp eax, 1
|
||||
je quit
|
||||
cmp ax, 0xFFAA ; page switcher
|
||||
je .switch_page ; any button with a character
|
||||
cmp ax, 0xEEBB ; page switcher
|
||||
je .switch_font
|
||||
.change_focus:
|
||||
mov bl, [symbol_focused]
|
||||
mov [symbol_unfocused], bl
|
||||
sub ax, BUTTON_ID_SHIFT ; get the corresponding character
|
||||
mov [symbol_focused], al
|
||||
stdcall draw_table, 0
|
||||
call draw_codes
|
||||
jmp still
|
||||
.switch_font:
|
||||
cmp [font_type], FONT_SMALL
|
||||
jne @f
|
||||
mov [font_type], FONT_BIG
|
||||
jmp redraw
|
||||
@@: mov [font_type], FONT_SMALL
|
||||
jmp redraw
|
||||
.switch_page:
|
||||
movzx bx, [symbol_start]
|
||||
add bx, BUTTON_ID_SHIFT
|
||||
mov cx, 128 ; half of page
|
||||
mov edx, 0x80000000
|
||||
mov dx, bx
|
||||
@@: mcall 8
|
||||
inc edx
|
||||
dec cx
|
||||
jnz @b
|
||||
|
||||
@@: add [symbol_start], 128 ; change page
|
||||
add [symbol_focused], 128
|
||||
stdcall draw_table, 1 ; 1 means redraw the whole table
|
||||
call draw_codes
|
||||
stdcall draw_page_switcher, 1 ; 1 means dark color, for blinking
|
||||
mcall 5, 10
|
||||
stdcall draw_page_switcher, 0 ; 0 means usual light color
|
||||
jmp still
|
||||
|
||||
redraw:
|
||||
mcall 9, proc_info, -1
|
||||
|
||||
mcall 12, 1
|
||||
|
||||
mcall 48, 4 ; get skin height
|
||||
mov ecx, 200*0x10000+PANEL_Y+33
|
||||
add ecx, eax
|
||||
mov ebx, 200*0x10000+BUTTON_SPACE*16+TABLE_BEGIN_X+TABLE_BEGIN_X+9
|
||||
mcall 0, , , 0x34AAAaaa, 0x80000000, window_title
|
||||
test [proc_info.wnd_state], 0x04
|
||||
jnz @f
|
||||
|
||||
stdcall draw_table, 1
|
||||
call draw_codes
|
||||
stdcall draw_page_switcher, 0
|
||||
stdcall draw_font_switcher
|
||||
|
||||
@@:
|
||||
mcall 12, 2
|
||||
jmp still
|
||||
|
||||
key:
|
||||
mcall 2
|
||||
cmp ah, 0x09 ; TAB key
|
||||
je button.switch_page
|
||||
|
||||
cmp ah, 0xB0 ; left
|
||||
jne @f
|
||||
mov bl, [symbol_focused]
|
||||
mov [symbol_unfocused], bl
|
||||
dec bl
|
||||
and bl, 0x0f
|
||||
and [symbol_focused], 0xf0
|
||||
or [symbol_focused], bl
|
||||
stdcall draw_table, 0
|
||||
call draw_codes
|
||||
jmp still
|
||||
|
||||
@@: cmp ah, 0xB1 ; down
|
||||
jne @f
|
||||
mov bl, [symbol_focused]
|
||||
mov [symbol_unfocused], bl
|
||||
add bl, 16
|
||||
and bl, 0x70
|
||||
and [symbol_focused], 0x8f
|
||||
or [symbol_focused], bl
|
||||
stdcall draw_table, 0
|
||||
call draw_codes
|
||||
jmp still
|
||||
|
||||
@@: cmp ah, 0xB2 ; up
|
||||
jne @f
|
||||
mov bl, [symbol_focused]
|
||||
mov [symbol_unfocused], bl
|
||||
sub bl, 16
|
||||
and bl, 0x70
|
||||
and [symbol_focused], 0x8f
|
||||
or [symbol_focused], bl
|
||||
stdcall draw_table, 0
|
||||
call draw_codes
|
||||
jmp still
|
||||
|
||||
@@: cmp ah, 0xB3 ; righ
|
||||
jne @f
|
||||
mov bl, [symbol_focused]
|
||||
mov [symbol_unfocused], bl
|
||||
inc bl
|
||||
and bl, 0x0f
|
||||
and [symbol_focused], 0xf0
|
||||
or [symbol_focused], bl
|
||||
stdcall draw_table, 0
|
||||
call draw_codes
|
||||
jmp still
|
||||
jne @f
|
||||
|
||||
@@:
|
||||
jmp still
|
||||
|
||||
|
||||
|
||||
proc draw_table _full_redraw
|
||||
|
||||
mov al, [symbol_start]
|
||||
mov [symbol_current], al
|
||||
|
||||
.next_button:
|
||||
|
||||
xor edi, edi ; character focus flag
|
||||
mov al, [symbol_current]
|
||||
cmp al, [symbol_focused]
|
||||
jne @f
|
||||
inc edi
|
||||
@@: cmp [_full_redraw], 1
|
||||
je .draw
|
||||
cmp al, [symbol_focused]
|
||||
je .draw
|
||||
cmp al, [symbol_unfocused] ; previously focused, should redraw to clear focus
|
||||
je .draw
|
||||
jmp .skip ; skip button if it isn't (un)focused
|
||||
|
||||
.draw:
|
||||
call draw_button
|
||||
.skip:
|
||||
mov bl, [symbol_start]
|
||||
add bl, 127 ; end of current page
|
||||
cmp [symbol_current], bl ; the last on page?
|
||||
jne @f
|
||||
mov [button_x], TABLE_BEGIN_X
|
||||
mov [button_y], TABLE_BEGIN_Y
|
||||
ret
|
||||
@@: inc [symbol_current]
|
||||
add [button_x], BUTTON_SPACE
|
||||
cmp [button_x], BUTTON_SPACE*16+TABLE_BEGIN_X ; the last in row?
|
||||
jne .next_button
|
||||
add [button_y], BUTTON_SPACE ; next row
|
||||
mov [button_x], TABLE_BEGIN_X
|
||||
jmp .next_button
|
||||
ret
|
||||
endp
|
||||
|
||||
|
||||
proc draw_button
|
||||
mov edx, 0x80000000
|
||||
mov dl, [symbol_current]
|
||||
add edx, BUTTON_ID_SHIFT
|
||||
mov esi, 0xFFFfff
|
||||
mcall 8, <[button_x],BUTTON_SIDE>, <[button_y],BUTTON_SIDE>
|
||||
and edx, 0x7FFFFFFF
|
||||
or edx, 0x20000000
|
||||
mcall
|
||||
|
||||
test edi, edi ; is focused?
|
||||
jz .symbol ; draw only character, not selection square
|
||||
.focus_frame: ; draw a blue square (selection), 8 segments
|
||||
mov esi, [button_x]
|
||||
mov edi, [button_y]
|
||||
|
||||
mov bx, si
|
||||
shl ebx, 16
|
||||
mov bx, si
|
||||
add bx, BUTTON_SIDE
|
||||
mov cx, di
|
||||
shl ecx, 16
|
||||
mov cx, di
|
||||
mcall 38, , , FOCUS_SQUARE_COLOR
|
||||
add ecx, 0x00010001
|
||||
mcall
|
||||
add ecx, (BUTTON_SIDE-2)*0x10000+(BUTTON_SIDE-2)
|
||||
mcall
|
||||
add ecx, 0x00010001
|
||||
mcall
|
||||
|
||||
mov bx, si
|
||||
shl ebx, 16
|
||||
mov bx, si
|
||||
mov cx, di
|
||||
shl ecx, 16
|
||||
mov cx, di
|
||||
add ecx, 2*0x10000+(BUTTON_SIDE-2)
|
||||
mcall 38, , ,
|
||||
add ebx, 0x00010001
|
||||
mcall
|
||||
add ebx, (BUTTON_SIDE-2)*0x10000+(BUTTON_SIDE-2)
|
||||
mcall
|
||||
add ebx, 0x00010001
|
||||
mcall
|
||||
|
||||
.symbol:
|
||||
mov ebx, [button_x]
|
||||
add ebx, 9
|
||||
shl ebx, 16
|
||||
add ebx, [button_y]
|
||||
add ebx, 7
|
||||
mov ecx, [font_type]
|
||||
mcall 4, , , symbol_current, 1
|
||||
|
||||
ret
|
||||
endp
|
||||
|
||||
|
||||
proc draw_page_switcher _blinking
|
||||
|
||||
mcall 8, , , 0x8000FFAA
|
||||
mov esi, 0xCCCccc
|
||||
cmp [_blinking], 1 ; blinking?
|
||||
jne @f
|
||||
mov esi, SWITCHER_BLINK_COLOR
|
||||
@@: mcall , <2,98>, <PANEL_Y+1,23>, 0x0000FFAA
|
||||
|
||||
mov ecx, 0x81000000
|
||||
mov edx, string_000_127
|
||||
cmp [symbol_start], 0 ; first page?
|
||||
je @f
|
||||
mov edx, string_128_255 ; ok, the second one
|
||||
@@: mcall 4, <10,PANEL_Y+6>,
|
||||
mcall , <278,PANEL_Y+6>, 0x81000000, string_ASCII_CODE
|
||||
|
||||
ret
|
||||
endp
|
||||
|
||||
proc draw_font_switcher
|
||||
|
||||
mcall 8, <120,136>, <PANEL_Y+1,23>, 0x0000EEBB
|
||||
|
||||
mov edx, string_font_small
|
||||
cmp [font_type], FONT_SMALL
|
||||
je @f
|
||||
mov edx, string_font_big
|
||||
@@: mcall 4, <130,PANEL_Y+6>,,,10
|
||||
|
||||
ret
|
||||
endp
|
||||
|
||||
|
||||
proc draw_codes
|
||||
|
||||
movzx ecx, [symbol_focused]
|
||||
mcall 47, 0x00030000, , <339,PANEL_Y+6>, 0x41000000, 0xAAAaaa
|
||||
mcall , 0x00020100, , <508,PANEL_Y+6>,
|
||||
|
||||
ret
|
||||
endp
|
||||
|
||||
|
||||
quit:
|
||||
mcall -1
|
||||
|
||||
|
||||
szZ window_title ,'ASCIIVju'
|
||||
szZ string_000_127 ,'000-127'
|
||||
szZ string_128_255 ,'128-255'
|
||||
szZ string_font_small ,'Font1 6x9 '
|
||||
szZ string_font_big ,'Font2 8x14'
|
||||
szZ string_ASCII_CODE ,'Code: Hex-Code:'
|
||||
|
||||
button_x dd 2
|
||||
button_y dd 2
|
||||
|
||||
font_type dd FONT_SMALL
|
||||
|
||||
symbol_current db 0
|
||||
symbol_start db 0
|
||||
|
||||
symbol_unfocused db 0
|
||||
symbol_focused db 0
|
||||
i_end:
|
||||
proc_info process_information
|
||||
rb 0x400 ;stack
|
||||
e_end:
|
||||
@@ -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())
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -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())
|
||||
|
||||
File renamed without changes.
File renamed without changes.
@@ -1,3 +1,9 @@
|
||||
; SPDX-License-Identifier: NOASSERTION
|
||||
;
|
||||
|
||||
; Text encoded with Code Page 866 - Cyrillic
|
||||
|
||||
|
||||
;; h2d2b v0.5 big fonts by Leency ;;
|
||||
;; 09.11.2016 ;;
|
||||
|
||||
@@ -17,11 +23,11 @@ use32
|
||||
db 'MENUET01'
|
||||
dd 1,start,i_end,e_end,e_end,0,sys_path
|
||||
|
||||
include '../../../proc32.inc'
|
||||
include '../../../macros.inc' ; макросы облегчают жизнь ассемблерщиков!
|
||||
include '../../../KOSfuncs.inc'
|
||||
include '../../../load_lib.mac'
|
||||
include '../../../develop/libraries/box_lib/trunk/box_lib.mac'
|
||||
include '../../proc32.inc'
|
||||
include '../../macros.inc' ; макросы облегчают жизнь ассемблерщиков!
|
||||
include '../../KOSfuncs.inc'
|
||||
include '../../load_lib.mac'
|
||||
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
|
||||
include 'lang.inc' ; Language support for locales: ru_RU (CP866), en_US.
|
||||
|
||||
@use_library
|
||||
@@ -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())
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,3 +1,9 @@
|
||||
; SPDX-License-Identifier: NOASSERTION
|
||||
;
|
||||
|
||||
; Text encoded with Code Page 866 - Cyrillic
|
||||
|
||||
|
||||
;--------------------------------------------------------------------
|
||||
; v.016 30.07.2011
|
||||
; Start with open file path
|
||||
@@ -60,11 +66,11 @@ use32
|
||||
_title equ 'HeEd 0.16', 0
|
||||
|
||||
include 'lang.inc' ; Language support for locales: ru_RU (CP866), en_US.
|
||||
include '../../../KOSfuncs.inc'
|
||||
include '../../../config.inc' ; for nightbuild
|
||||
include '../../../macros.inc'
|
||||
include '../../libraries/box_lib/trunk/box_lib.mac'
|
||||
include '../../../load_lib.mac'
|
||||
include '../../KOSfuncs.inc'
|
||||
include '../../config.inc' ; for nightbuild
|
||||
include '../../macros.inc'
|
||||
include '../libraries/box_lib/trunk/box_lib.mac'
|
||||
include '../../load_lib.mac'
|
||||
|
||||
@use_library
|
||||
;--------------------------------------------------------------------
|
||||
File renamed without changes.
@@ -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())
|
||||
|
||||
File renamed without changes.
File renamed without changes.
+4
-3
@@ -1,3 +1,6 @@
|
||||
; SPDX-License-Identifier: NOASSERTION
|
||||
;
|
||||
|
||||
; Author: M. Lisovin
|
||||
; Compile with FASM for Menuet
|
||||
;
|
||||
@@ -15,7 +18,7 @@ use32
|
||||
dd 0x0 , 0x0 ; I_Param , I_Icon
|
||||
|
||||
include 'lang.inc'
|
||||
include '..\..\..\macros.inc'
|
||||
include '..\..\macros.inc'
|
||||
|
||||
START: ; start of execution
|
||||
red:
|
||||
@@ -107,5 +110,3 @@ draw_window:
|
||||
I_END:
|
||||
keyid: rb 1
|
||||
scan_keyid: rb 1
|
||||
|
||||
|
||||
@@ -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())
|
||||
|
||||
File renamed without changes.
File renamed without changes.
+8
-2
@@ -1,3 +1,9 @@
|
||||
; SPDX-License-Identifier: NOASSERTION
|
||||
;
|
||||
|
||||
; Text encoded with Code Page 866 - Cyrillic
|
||||
|
||||
|
||||
;
|
||||
; KEYBOARD SCANCODE EXAMPLE
|
||||
;
|
||||
@@ -5,7 +11,7 @@
|
||||
;
|
||||
|
||||
include "lang.inc"
|
||||
include "..\..\..\macros.inc"
|
||||
include "..\..\macros.inc"
|
||||
|
||||
use32
|
||||
org 0x0
|
||||
@@ -165,7 +171,7 @@ draw_window:
|
||||
or edx, 0x34000000
|
||||
mov edi, title ; WINDOW LABEL
|
||||
mcall
|
||||
|
||||
|
||||
mov eax, 4
|
||||
mov ebx, 15*65536+10
|
||||
xor ecx, ecx
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+269
-270
@@ -1,270 +1,269 @@
|
||||
|
||||
include '../../../../proc32.inc'
|
||||
|
||||
struc system_colors
|
||||
{
|
||||
.frame dd ?
|
||||
.grab dd ?
|
||||
.work_dark dd ?
|
||||
.work_light dd ?
|
||||
.grab_text dd ?
|
||||
.work dd ?
|
||||
.work_button dd ?
|
||||
.work_button_text dd ?
|
||||
.work_text dd ?
|
||||
.work_graph dd ?
|
||||
}
|
||||
|
||||
use32
|
||||
|
||||
db 'MENUET01'
|
||||
dd 1
|
||||
dd start
|
||||
dd i_end
|
||||
dd mem
|
||||
dd mem
|
||||
dd 0
|
||||
dd 0
|
||||
|
||||
include 'pixlib.inc'
|
||||
|
||||
align 4
|
||||
start:
|
||||
call load_pxlib
|
||||
test eax, eax
|
||||
jz .fail
|
||||
|
||||
sub esp, 1024
|
||||
|
||||
mov eax, 9
|
||||
mov ebx, esp
|
||||
mov ecx, -1
|
||||
int 0x40
|
||||
|
||||
movzx ecx, word [esp+0x1E]
|
||||
mov eax, 18
|
||||
mov ebx, 21
|
||||
int 0x40
|
||||
|
||||
mov [slot], eax
|
||||
|
||||
add esp, 1024
|
||||
|
||||
mov eax,48 ; get system colors
|
||||
mov ebx,3
|
||||
mov ecx,sc
|
||||
mov edx,10*4
|
||||
int 0x40
|
||||
.redraw:
|
||||
call draw_window
|
||||
|
||||
.wait_event:
|
||||
|
||||
mov eax, 18
|
||||
mov ebx, 7
|
||||
int 0x40
|
||||
cmp eax, [slot]
|
||||
jne .skip_draw
|
||||
|
||||
sub esp, 1024
|
||||
|
||||
mov eax, 9
|
||||
mov ebx, esp
|
||||
mov ecx, -1
|
||||
int 0x40
|
||||
|
||||
mov edx, [esp+0x22]; xwin
|
||||
mov ecx, [esp+0x26]; ywin
|
||||
add edx, [esp+0x36]
|
||||
add ecx, [esp+0x3A]
|
||||
|
||||
mov eax, [esp+0x3E]
|
||||
mov ebx, [esp+0x42]
|
||||
|
||||
add esp, 1024
|
||||
|
||||
test eax, eax
|
||||
jle .skip_draw
|
||||
test ebx, ebx
|
||||
jle .skip_draw
|
||||
|
||||
push ebx
|
||||
push eax
|
||||
push ecx
|
||||
push edx
|
||||
call _Draw
|
||||
add esp, 16
|
||||
|
||||
.skip_draw:
|
||||
|
||||
; mov ebx, 1
|
||||
; mov eax, 23
|
||||
; int 0x40
|
||||
|
||||
mov eax, 11
|
||||
int 0x40
|
||||
|
||||
dec eax ; if event = 1
|
||||
js .wait_event
|
||||
|
||||
jz .redraw ; jump to redraw handler
|
||||
dec eax ; else if event = 2
|
||||
jz .key ; jump to key handler
|
||||
dec eax
|
||||
jz .button
|
||||
|
||||
jmp .wait_event
|
||||
|
||||
.button: ; button event handler
|
||||
mov al, 17 ; get button identifier
|
||||
int 0x40
|
||||
|
||||
cmp ah, 1
|
||||
jne .wait_event ; return if button id != 1
|
||||
.exit:
|
||||
; restore old screen and cleanup
|
||||
.fail:
|
||||
or eax, -1 ; exit application
|
||||
int 0x40
|
||||
.key: ; key event handler
|
||||
mov al, 2 ; get key code
|
||||
int 0x40
|
||||
|
||||
jmp .wait_event
|
||||
|
||||
draw_window:
|
||||
mov eax, 12 ; start drawing
|
||||
mov ebx, 1
|
||||
int 0x40
|
||||
|
||||
xor eax, eax ; create and draw the window
|
||||
mov ebx, 100*65536+320 ; (window_cx)*65536+(window_sx)
|
||||
mov ecx, 100*65536+240 ; (window_cy)*65536+(window_sy)
|
||||
mov edx, [sc.work] ; work area color
|
||||
or edx, 0x33000000 ; & window type 3
|
||||
mov edi, title ; window title
|
||||
int 0x40
|
||||
|
||||
mov eax, 12 ; finish drawing
|
||||
mov ebx, 2
|
||||
int 0x40
|
||||
|
||||
ret
|
||||
|
||||
DWORD equ dword
|
||||
PTR equ
|
||||
|
||||
_Draw:
|
||||
push ebp
|
||||
xor edx, edx
|
||||
push edi
|
||||
push esi
|
||||
push ebx
|
||||
sub esp, 44
|
||||
imul eax, DWORD PTR [_glSeed], 69069
|
||||
mov ebp, DWORD PTR [esp+72]
|
||||
mov ecx, DWORD PTR [esp+76]
|
||||
inc eax
|
||||
mov DWORD PTR [esp+32], eax
|
||||
imul eax, eax, 69069
|
||||
inc eax
|
||||
mov DWORD PTR [esp+36], eax
|
||||
imul eax, eax, 69069
|
||||
inc eax
|
||||
mov DWORD PTR [esp+40], eax
|
||||
imul eax, eax, 69069
|
||||
lea ebx, [eax+1]
|
||||
mov eax, ebx
|
||||
div ebp
|
||||
imul eax, ebx, 69069
|
||||
lea ebx, [eax+1]
|
||||
mov eax, ebx
|
||||
mov edi, edx
|
||||
xor edx, edx
|
||||
div ecx
|
||||
imul eax, ebx, 69069
|
||||
lea ebx, [eax+1]
|
||||
mov eax, ebx
|
||||
mov esi, edx
|
||||
xor edx, edx
|
||||
div ebp
|
||||
imul eax, ebx, 69069
|
||||
inc eax
|
||||
mov DWORD PTR [_glSeed], eax
|
||||
mov ebp, edx
|
||||
mov DWORD PTR [esp+28], edx
|
||||
xor edx, edx
|
||||
div ecx
|
||||
cmp ebp, edi
|
||||
mov ebx, edx
|
||||
jge L2
|
||||
mov DWORD PTR [esp+28], edi
|
||||
mov edi, ebp
|
||||
L2:
|
||||
cmp ebx, esi
|
||||
jge L4
|
||||
mov ebx, esi
|
||||
mov esi, edx
|
||||
L4:
|
||||
push eax
|
||||
mov ecx, 255
|
||||
push -16777216
|
||||
mov eax, DWORD PTR [esp+40]
|
||||
xor edx, edx
|
||||
div ecx
|
||||
mov eax, DWORD PTR [esp+48]
|
||||
mov ebp, edx
|
||||
xor edx, edx
|
||||
div ecx
|
||||
mov eax, DWORD PTR [esp+44]
|
||||
sal ebp, 16
|
||||
or ebp, -16777216
|
||||
mov DWORD PTR [esp+8], edx
|
||||
or ebp, edx
|
||||
xor edx, edx
|
||||
div ecx
|
||||
lea eax, [ebx+1]
|
||||
sub eax, esi
|
||||
sal edx, 8
|
||||
or ebp, edx
|
||||
push ebp
|
||||
push eax
|
||||
mov eax, DWORD PTR [esp+44]
|
||||
inc eax
|
||||
sub eax, edi
|
||||
push eax
|
||||
mov eax, esi
|
||||
add eax, DWORD PTR [esp+88]
|
||||
push eax
|
||||
mov eax, edi
|
||||
add eax, DWORD PTR [esp+88]
|
||||
push eax
|
||||
push -1
|
||||
call [imp_DrawRect]
|
||||
add esp, 76
|
||||
pop ebx
|
||||
pop esi
|
||||
pop edi
|
||||
pop ebp
|
||||
ret
|
||||
align 4
|
||||
|
||||
count dd 0
|
||||
_glSeed dd -365387184
|
||||
|
||||
title db 'Draw rect demo',0
|
||||
|
||||
i_end:
|
||||
|
||||
align 4
|
||||
|
||||
slot rd 1
|
||||
|
||||
sc system_colors
|
||||
|
||||
align 16
|
||||
|
||||
|
||||
rb 2048 ;stack
|
||||
mem:
|
||||
|
||||
|
||||
include '../../../proc32.inc'
|
||||
|
||||
struc system_colors
|
||||
{
|
||||
.frame dd ?
|
||||
.grab dd ?
|
||||
.work_dark dd ?
|
||||
.work_light dd ?
|
||||
.grab_text dd ?
|
||||
.work dd ?
|
||||
.work_button dd ?
|
||||
.work_button_text dd ?
|
||||
.work_text dd ?
|
||||
.work_graph dd ?
|
||||
}
|
||||
|
||||
use32
|
||||
|
||||
db 'MENUET01'
|
||||
dd 1
|
||||
dd start
|
||||
dd i_end
|
||||
dd mem
|
||||
dd mem
|
||||
dd 0
|
||||
dd 0
|
||||
|
||||
include 'pixlib.inc'
|
||||
|
||||
align 4
|
||||
start:
|
||||
call load_pxlib
|
||||
test eax, eax
|
||||
jz .fail
|
||||
|
||||
sub esp, 1024
|
||||
|
||||
mov eax, 9
|
||||
mov ebx, esp
|
||||
mov ecx, -1
|
||||
int 0x40
|
||||
|
||||
movzx ecx, word [esp+0x1E]
|
||||
mov eax, 18
|
||||
mov ebx, 21
|
||||
int 0x40
|
||||
|
||||
mov [slot], eax
|
||||
|
||||
add esp, 1024
|
||||
|
||||
mov eax,48 ; get system colors
|
||||
mov ebx,3
|
||||
mov ecx,sc
|
||||
mov edx,10*4
|
||||
int 0x40
|
||||
.redraw:
|
||||
call draw_window
|
||||
|
||||
.wait_event:
|
||||
|
||||
mov eax, 18
|
||||
mov ebx, 7
|
||||
int 0x40
|
||||
cmp eax, [slot]
|
||||
jne .skip_draw
|
||||
|
||||
sub esp, 1024
|
||||
|
||||
mov eax, 9
|
||||
mov ebx, esp
|
||||
mov ecx, -1
|
||||
int 0x40
|
||||
|
||||
mov edx, [esp+0x22]; xwin
|
||||
mov ecx, [esp+0x26]; ywin
|
||||
add edx, [esp+0x36]
|
||||
add ecx, [esp+0x3A]
|
||||
|
||||
mov eax, [esp+0x3E]
|
||||
mov ebx, [esp+0x42]
|
||||
|
||||
add esp, 1024
|
||||
|
||||
test eax, eax
|
||||
jle .skip_draw
|
||||
test ebx, ebx
|
||||
jle .skip_draw
|
||||
|
||||
push ebx
|
||||
push eax
|
||||
push ecx
|
||||
push edx
|
||||
call _Draw
|
||||
add esp, 16
|
||||
|
||||
.skip_draw:
|
||||
|
||||
; mov ebx, 1
|
||||
; mov eax, 23
|
||||
; int 0x40
|
||||
|
||||
mov eax, 11
|
||||
int 0x40
|
||||
|
||||
dec eax ; if event = 1
|
||||
js .wait_event
|
||||
|
||||
jz .redraw ; jump to redraw handler
|
||||
dec eax ; else if event = 2
|
||||
jz .key ; jump to key handler
|
||||
dec eax
|
||||
jz .button
|
||||
|
||||
jmp .wait_event
|
||||
|
||||
.button: ; button event handler
|
||||
mov al, 17 ; get button identifier
|
||||
int 0x40
|
||||
|
||||
cmp ah, 1
|
||||
jne .wait_event ; return if button id != 1
|
||||
.exit:
|
||||
; restore old screen and cleanup
|
||||
.fail:
|
||||
or eax, -1 ; exit application
|
||||
int 0x40
|
||||
.key: ; key event handler
|
||||
mov al, 2 ; get key code
|
||||
int 0x40
|
||||
|
||||
jmp .wait_event
|
||||
|
||||
draw_window:
|
||||
mov eax, 12 ; start drawing
|
||||
mov ebx, 1
|
||||
int 0x40
|
||||
|
||||
xor eax, eax ; create and draw the window
|
||||
mov ebx, 100*65536+320 ; (window_cx)*65536+(window_sx)
|
||||
mov ecx, 100*65536+240 ; (window_cy)*65536+(window_sy)
|
||||
mov edx, [sc.work] ; work area color
|
||||
or edx, 0x33000000 ; & window type 3
|
||||
mov edi, title ; window title
|
||||
int 0x40
|
||||
|
||||
mov eax, 12 ; finish drawing
|
||||
mov ebx, 2
|
||||
int 0x40
|
||||
|
||||
ret
|
||||
|
||||
DWORD equ dword
|
||||
PTR equ
|
||||
|
||||
_Draw:
|
||||
push ebp
|
||||
xor edx, edx
|
||||
push edi
|
||||
push esi
|
||||
push ebx
|
||||
sub esp, 44
|
||||
imul eax, DWORD PTR [_glSeed], 69069
|
||||
mov ebp, DWORD PTR [esp+72]
|
||||
mov ecx, DWORD PTR [esp+76]
|
||||
inc eax
|
||||
mov DWORD PTR [esp+32], eax
|
||||
imul eax, eax, 69069
|
||||
inc eax
|
||||
mov DWORD PTR [esp+36], eax
|
||||
imul eax, eax, 69069
|
||||
inc eax
|
||||
mov DWORD PTR [esp+40], eax
|
||||
imul eax, eax, 69069
|
||||
lea ebx, [eax+1]
|
||||
mov eax, ebx
|
||||
div ebp
|
||||
imul eax, ebx, 69069
|
||||
lea ebx, [eax+1]
|
||||
mov eax, ebx
|
||||
mov edi, edx
|
||||
xor edx, edx
|
||||
div ecx
|
||||
imul eax, ebx, 69069
|
||||
lea ebx, [eax+1]
|
||||
mov eax, ebx
|
||||
mov esi, edx
|
||||
xor edx, edx
|
||||
div ebp
|
||||
imul eax, ebx, 69069
|
||||
inc eax
|
||||
mov DWORD PTR [_glSeed], eax
|
||||
mov ebp, edx
|
||||
mov DWORD PTR [esp+28], edx
|
||||
xor edx, edx
|
||||
div ecx
|
||||
cmp ebp, edi
|
||||
mov ebx, edx
|
||||
jge L2
|
||||
mov DWORD PTR [esp+28], edi
|
||||
mov edi, ebp
|
||||
L2:
|
||||
cmp ebx, esi
|
||||
jge L4
|
||||
mov ebx, esi
|
||||
mov esi, edx
|
||||
L4:
|
||||
push eax
|
||||
mov ecx, 255
|
||||
push -16777216
|
||||
mov eax, DWORD PTR [esp+40]
|
||||
xor edx, edx
|
||||
div ecx
|
||||
mov eax, DWORD PTR [esp+48]
|
||||
mov ebp, edx
|
||||
xor edx, edx
|
||||
div ecx
|
||||
mov eax, DWORD PTR [esp+44]
|
||||
sal ebp, 16
|
||||
or ebp, -16777216
|
||||
mov DWORD PTR [esp+8], edx
|
||||
or ebp, edx
|
||||
xor edx, edx
|
||||
div ecx
|
||||
lea eax, [ebx+1]
|
||||
sub eax, esi
|
||||
sal edx, 8
|
||||
or ebp, edx
|
||||
push ebp
|
||||
push eax
|
||||
mov eax, DWORD PTR [esp+44]
|
||||
inc eax
|
||||
sub eax, edi
|
||||
push eax
|
||||
mov eax, esi
|
||||
add eax, DWORD PTR [esp+88]
|
||||
push eax
|
||||
mov eax, edi
|
||||
add eax, DWORD PTR [esp+88]
|
||||
push eax
|
||||
push -1
|
||||
call [imp_DrawRect]
|
||||
add esp, 76
|
||||
pop ebx
|
||||
pop esi
|
||||
pop edi
|
||||
pop ebp
|
||||
ret
|
||||
align 4
|
||||
|
||||
count dd 0
|
||||
_glSeed dd -365387184
|
||||
|
||||
title db 'Draw rect demo',0
|
||||
|
||||
i_end:
|
||||
|
||||
align 4
|
||||
|
||||
slot rd 1
|
||||
|
||||
sc system_colors
|
||||
|
||||
align 16
|
||||
|
||||
|
||||
rb 2048 ;stack
|
||||
mem:
|
||||
+277
-278
@@ -1,278 +1,277 @@
|
||||
|
||||
include '../../../../proc32.inc'
|
||||
|
||||
struc system_colors
|
||||
{
|
||||
.frame dd ?
|
||||
.grab dd ?
|
||||
.work_dark dd ?
|
||||
.work_light dd ?
|
||||
.grab_text dd ?
|
||||
.work dd ?
|
||||
.work_button dd ?
|
||||
.work_button_text dd ?
|
||||
.work_text dd ?
|
||||
.work_graph dd ?
|
||||
}
|
||||
|
||||
use32
|
||||
|
||||
db 'MENUET01'
|
||||
dd 1
|
||||
dd start
|
||||
dd i_end
|
||||
dd mem
|
||||
dd mem
|
||||
dd 0
|
||||
dd 0
|
||||
|
||||
include 'pixlib.inc'
|
||||
|
||||
align 4
|
||||
start:
|
||||
call load_pxlib
|
||||
test eax, eax
|
||||
jz .fail
|
||||
|
||||
sub esp, 1024
|
||||
|
||||
mov eax, 9
|
||||
mov ebx, esp
|
||||
mov ecx, -1
|
||||
int 0x40
|
||||
|
||||
movzx ecx, word [esp+0x1E]
|
||||
mov eax, 18
|
||||
mov ebx, 21
|
||||
int 0x40
|
||||
|
||||
mov [slot], eax
|
||||
|
||||
add esp, 1024
|
||||
|
||||
mov eax,48 ; get system colors
|
||||
mov ebx,3
|
||||
mov ecx,sc
|
||||
mov edx,10*4
|
||||
int 0x40
|
||||
|
||||
CreateHatch HS_CROSS, 0xFFFFFFFF, 0xFF000000
|
||||
mov [br_cross], eax
|
||||
|
||||
CreateHatch HS_DIAGCROSS, 0xFFFFFFFF, 0xFF000000
|
||||
mov [br_dcross], eax
|
||||
|
||||
CreateHatch HS_HORIZONTAL, 0xFFFFFFFF, 0xFF000000
|
||||
mov [br_horz], eax
|
||||
|
||||
CreateHatch HS_VERTICAL, 0xFFFFFFFF, 0xFF000000
|
||||
mov [br_vert], eax
|
||||
|
||||
CreateHatch HS_FDIAGONAL, 0xFFFFFFFF, 0xFF000000
|
||||
mov [br_fd], eax
|
||||
|
||||
CreateHatch HS_BDIAGONAL, 0xFFFFFFFF, 0xFF000000
|
||||
mov [br_bd], eax
|
||||
|
||||
.redraw:
|
||||
call draw_window
|
||||
|
||||
.wait_event:
|
||||
|
||||
mov eax, 18
|
||||
mov ebx, 7
|
||||
int 0x40
|
||||
cmp eax, [slot]
|
||||
jne .skip_draw
|
||||
|
||||
sub esp, 1024
|
||||
|
||||
mov eax, 9
|
||||
mov ebx, esp
|
||||
mov ecx, -1
|
||||
int 0x40
|
||||
|
||||
mov edx, [esp+0x22]; xwin
|
||||
mov ecx, [esp+0x26]; ywin
|
||||
add edx, [esp+0x36]
|
||||
add ecx, [esp+0x3A]
|
||||
|
||||
mov eax, [esp+0x3E] ;width
|
||||
mov ebx, [esp+0x42] ;height
|
||||
|
||||
add esp, 1024
|
||||
|
||||
cmp eax, 50
|
||||
jle .skip_draw
|
||||
|
||||
cmp ebx, 40
|
||||
jle .skip_draw
|
||||
|
||||
push ebx
|
||||
push eax
|
||||
push ecx
|
||||
push edx
|
||||
call _Draw
|
||||
add esp, 16
|
||||
|
||||
.skip_draw:
|
||||
|
||||
mov ebx, 1000
|
||||
mov eax, 23
|
||||
int 0x40
|
||||
|
||||
; mov eax, 11
|
||||
; int 0x40
|
||||
|
||||
dec eax ; if event = 1
|
||||
; js .wait_event
|
||||
|
||||
jz .redraw ; jump to redraw handler
|
||||
dec eax ; else if event = 2
|
||||
jz .key ; jump to key handler
|
||||
dec eax
|
||||
jz .button
|
||||
|
||||
jmp .wait_event
|
||||
|
||||
.button: ; button event handler
|
||||
mov al, 17 ; get button identifier
|
||||
int 0x40
|
||||
|
||||
cmp ah, 1
|
||||
jne .wait_event ; return if button id != 1
|
||||
.exit:
|
||||
; restore old screen and cleanup
|
||||
.fail:
|
||||
or eax, -1 ; exit application
|
||||
int 0x40
|
||||
.key: ; key event handler
|
||||
mov al, 2 ; get key code
|
||||
int 0x40
|
||||
|
||||
jmp .wait_event
|
||||
|
||||
draw_window:
|
||||
mov eax, 12 ; start drawing
|
||||
mov ebx, 1
|
||||
int 0x40
|
||||
|
||||
xor eax, eax ; create and draw the window
|
||||
mov ebx, 100*65536+320 ; (window_cx)*65536+(window_sx)
|
||||
mov ecx, 100*65536+240 ; (window_cy)*65536+(window_sy)
|
||||
mov edx, [sc.work] ; work area color
|
||||
or edx, 0x33000000 ; & window type 3
|
||||
mov edi, title ; window title
|
||||
int 0x40
|
||||
|
||||
mov eax, 12 ; finish drawing
|
||||
mov ebx, 2
|
||||
int 0x40
|
||||
|
||||
ret
|
||||
|
||||
DWORD equ dword
|
||||
PTR equ
|
||||
|
||||
_Draw:
|
||||
push ebp
|
||||
push edi
|
||||
push esi
|
||||
push ebx
|
||||
mov ebx, 1431655766
|
||||
sub esp, 44
|
||||
mov esi, DWORD PTR [esp+72]
|
||||
mov ecx, DWORD PTR [esp+76]
|
||||
mov DWORD PTR [esp+24], -16777216
|
||||
mov DWORD PTR [esp], -1
|
||||
lea edi, [esi-40]
|
||||
mov eax, edi
|
||||
imul ebx
|
||||
sar edi, 31
|
||||
lea eax, [ecx-30]
|
||||
sub ecx, 10
|
||||
mov ebp, edx
|
||||
sub ebp, edi
|
||||
mov edi, eax
|
||||
shr edi, 31
|
||||
add edi, eax
|
||||
lea edx, [esi-20]
|
||||
lea eax, [ebp+ebp*2]
|
||||
sub edx, eax
|
||||
mov esi, edx
|
||||
shr esi, 31
|
||||
add esi, edx
|
||||
sar esi, 1
|
||||
add esi, DWORD PTR [esp+64]
|
||||
sar edi, 1
|
||||
lea eax, [ebp+10+esi]
|
||||
mov DWORD PTR [esp+32], eax
|
||||
lea eax, [edi+edi]
|
||||
sub ecx, eax
|
||||
mov ebx, ecx
|
||||
shr ebx, 31
|
||||
add ebx, ecx
|
||||
sar ebx, 1
|
||||
add ebx, DWORD PTR [esp+68]
|
||||
lea edx, [esi+20+ebp*2]
|
||||
mov DWORD PTR [esp+36], edx
|
||||
lea eax, [ebx+10+edi]
|
||||
mov DWORD PTR [esp+40], eax
|
||||
|
||||
FillRect -1, esi, ebx,ebp, edi, [br_fd], 0xFF000000
|
||||
|
||||
mov edx, DWORD PTR [esp+32]
|
||||
FillRect -1, edx, ebx, ebp, edi, [br_cross], 0xFF000000
|
||||
|
||||
mov eax, DWORD PTR [esp+36]
|
||||
FillRect -1, eax, ebx, ebp, edi, [br_horz],0xFF000000
|
||||
|
||||
mov edx, DWORD PTR [esp+40]
|
||||
FillRect -1, esi, edx, ebp, edi, [br_bd], 0xFF000000
|
||||
|
||||
mov edx, DWORD PTR [esp+32]
|
||||
mov eax, DWORD PTR [esp+40]
|
||||
FillRect -1, edx, eax, ebp, edi, [br_dcross], 0xFF000000
|
||||
|
||||
mov edx, DWORD PTR [esp+36]
|
||||
mov eax, DWORD PTR [esp+40]
|
||||
FillRect -1, edx, eax, ebp, edi, [br_vert], 0xFF000000
|
||||
|
||||
call [imp_FillRect]
|
||||
|
||||
|
||||
add esp, 44
|
||||
pop ebx
|
||||
pop esi
|
||||
pop edi
|
||||
pop ebp
|
||||
ret
|
||||
|
||||
align 4
|
||||
|
||||
|
||||
count dd 0
|
||||
|
||||
title db 'Hatches',0
|
||||
|
||||
i_end:
|
||||
|
||||
align 4
|
||||
|
||||
slot rd 1
|
||||
|
||||
br_fd rd 1
|
||||
br_bd rd 1
|
||||
br_cross rd 1
|
||||
br_dcross rd 1
|
||||
br_horz rd 1
|
||||
br_vert rd 1
|
||||
|
||||
sc system_colors
|
||||
|
||||
align 16
|
||||
|
||||
|
||||
rb 2048 ;stack
|
||||
mem:
|
||||
|
||||
|
||||
include '../../../proc32.inc'
|
||||
|
||||
struc system_colors
|
||||
{
|
||||
.frame dd ?
|
||||
.grab dd ?
|
||||
.work_dark dd ?
|
||||
.work_light dd ?
|
||||
.grab_text dd ?
|
||||
.work dd ?
|
||||
.work_button dd ?
|
||||
.work_button_text dd ?
|
||||
.work_text dd ?
|
||||
.work_graph dd ?
|
||||
}
|
||||
|
||||
use32
|
||||
|
||||
db 'MENUET01'
|
||||
dd 1
|
||||
dd start
|
||||
dd i_end
|
||||
dd mem
|
||||
dd mem
|
||||
dd 0
|
||||
dd 0
|
||||
|
||||
include 'pixlib.inc'
|
||||
|
||||
align 4
|
||||
start:
|
||||
call load_pxlib
|
||||
test eax, eax
|
||||
jz .fail
|
||||
|
||||
sub esp, 1024
|
||||
|
||||
mov eax, 9
|
||||
mov ebx, esp
|
||||
mov ecx, -1
|
||||
int 0x40
|
||||
|
||||
movzx ecx, word [esp+0x1E]
|
||||
mov eax, 18
|
||||
mov ebx, 21
|
||||
int 0x40
|
||||
|
||||
mov [slot], eax
|
||||
|
||||
add esp, 1024
|
||||
|
||||
mov eax,48 ; get system colors
|
||||
mov ebx,3
|
||||
mov ecx,sc
|
||||
mov edx,10*4
|
||||
int 0x40
|
||||
|
||||
CreateHatch HS_CROSS, 0xFFFFFFFF, 0xFF000000
|
||||
mov [br_cross], eax
|
||||
|
||||
CreateHatch HS_DIAGCROSS, 0xFFFFFFFF, 0xFF000000
|
||||
mov [br_dcross], eax
|
||||
|
||||
CreateHatch HS_HORIZONTAL, 0xFFFFFFFF, 0xFF000000
|
||||
mov [br_horz], eax
|
||||
|
||||
CreateHatch HS_VERTICAL, 0xFFFFFFFF, 0xFF000000
|
||||
mov [br_vert], eax
|
||||
|
||||
CreateHatch HS_FDIAGONAL, 0xFFFFFFFF, 0xFF000000
|
||||
mov [br_fd], eax
|
||||
|
||||
CreateHatch HS_BDIAGONAL, 0xFFFFFFFF, 0xFF000000
|
||||
mov [br_bd], eax
|
||||
|
||||
.redraw:
|
||||
call draw_window
|
||||
|
||||
.wait_event:
|
||||
|
||||
mov eax, 18
|
||||
mov ebx, 7
|
||||
int 0x40
|
||||
cmp eax, [slot]
|
||||
jne .skip_draw
|
||||
|
||||
sub esp, 1024
|
||||
|
||||
mov eax, 9
|
||||
mov ebx, esp
|
||||
mov ecx, -1
|
||||
int 0x40
|
||||
|
||||
mov edx, [esp+0x22]; xwin
|
||||
mov ecx, [esp+0x26]; ywin
|
||||
add edx, [esp+0x36]
|
||||
add ecx, [esp+0x3A]
|
||||
|
||||
mov eax, [esp+0x3E] ;width
|
||||
mov ebx, [esp+0x42] ;height
|
||||
|
||||
add esp, 1024
|
||||
|
||||
cmp eax, 50
|
||||
jle .skip_draw
|
||||
|
||||
cmp ebx, 40
|
||||
jle .skip_draw
|
||||
|
||||
push ebx
|
||||
push eax
|
||||
push ecx
|
||||
push edx
|
||||
call _Draw
|
||||
add esp, 16
|
||||
|
||||
.skip_draw:
|
||||
|
||||
mov ebx, 1000
|
||||
mov eax, 23
|
||||
int 0x40
|
||||
|
||||
; mov eax, 11
|
||||
; int 0x40
|
||||
|
||||
dec eax ; if event = 1
|
||||
; js .wait_event
|
||||
|
||||
jz .redraw ; jump to redraw handler
|
||||
dec eax ; else if event = 2
|
||||
jz .key ; jump to key handler
|
||||
dec eax
|
||||
jz .button
|
||||
|
||||
jmp .wait_event
|
||||
|
||||
.button: ; button event handler
|
||||
mov al, 17 ; get button identifier
|
||||
int 0x40
|
||||
|
||||
cmp ah, 1
|
||||
jne .wait_event ; return if button id != 1
|
||||
.exit:
|
||||
; restore old screen and cleanup
|
||||
.fail:
|
||||
or eax, -1 ; exit application
|
||||
int 0x40
|
||||
.key: ; key event handler
|
||||
mov al, 2 ; get key code
|
||||
int 0x40
|
||||
|
||||
jmp .wait_event
|
||||
|
||||
draw_window:
|
||||
mov eax, 12 ; start drawing
|
||||
mov ebx, 1
|
||||
int 0x40
|
||||
|
||||
xor eax, eax ; create and draw the window
|
||||
mov ebx, 100*65536+320 ; (window_cx)*65536+(window_sx)
|
||||
mov ecx, 100*65536+240 ; (window_cy)*65536+(window_sy)
|
||||
mov edx, [sc.work] ; work area color
|
||||
or edx, 0x33000000 ; & window type 3
|
||||
mov edi, title ; window title
|
||||
int 0x40
|
||||
|
||||
mov eax, 12 ; finish drawing
|
||||
mov ebx, 2
|
||||
int 0x40
|
||||
|
||||
ret
|
||||
|
||||
DWORD equ dword
|
||||
PTR equ
|
||||
|
||||
_Draw:
|
||||
push ebp
|
||||
push edi
|
||||
push esi
|
||||
push ebx
|
||||
mov ebx, 1431655766
|
||||
sub esp, 44
|
||||
mov esi, DWORD PTR [esp+72]
|
||||
mov ecx, DWORD PTR [esp+76]
|
||||
mov DWORD PTR [esp+24], -16777216
|
||||
mov DWORD PTR [esp], -1
|
||||
lea edi, [esi-40]
|
||||
mov eax, edi
|
||||
imul ebx
|
||||
sar edi, 31
|
||||
lea eax, [ecx-30]
|
||||
sub ecx, 10
|
||||
mov ebp, edx
|
||||
sub ebp, edi
|
||||
mov edi, eax
|
||||
shr edi, 31
|
||||
add edi, eax
|
||||
lea edx, [esi-20]
|
||||
lea eax, [ebp+ebp*2]
|
||||
sub edx, eax
|
||||
mov esi, edx
|
||||
shr esi, 31
|
||||
add esi, edx
|
||||
sar esi, 1
|
||||
add esi, DWORD PTR [esp+64]
|
||||
sar edi, 1
|
||||
lea eax, [ebp+10+esi]
|
||||
mov DWORD PTR [esp+32], eax
|
||||
lea eax, [edi+edi]
|
||||
sub ecx, eax
|
||||
mov ebx, ecx
|
||||
shr ebx, 31
|
||||
add ebx, ecx
|
||||
sar ebx, 1
|
||||
add ebx, DWORD PTR [esp+68]
|
||||
lea edx, [esi+20+ebp*2]
|
||||
mov DWORD PTR [esp+36], edx
|
||||
lea eax, [ebx+10+edi]
|
||||
mov DWORD PTR [esp+40], eax
|
||||
|
||||
FillRect -1, esi, ebx,ebp, edi, [br_fd], 0xFF000000
|
||||
|
||||
mov edx, DWORD PTR [esp+32]
|
||||
FillRect -1, edx, ebx, ebp, edi, [br_cross], 0xFF000000
|
||||
|
||||
mov eax, DWORD PTR [esp+36]
|
||||
FillRect -1, eax, ebx, ebp, edi, [br_horz],0xFF000000
|
||||
|
||||
mov edx, DWORD PTR [esp+40]
|
||||
FillRect -1, esi, edx, ebp, edi, [br_bd], 0xFF000000
|
||||
|
||||
mov edx, DWORD PTR [esp+32]
|
||||
mov eax, DWORD PTR [esp+40]
|
||||
FillRect -1, edx, eax, ebp, edi, [br_dcross], 0xFF000000
|
||||
|
||||
mov edx, DWORD PTR [esp+36]
|
||||
mov eax, DWORD PTR [esp+40]
|
||||
FillRect -1, edx, eax, ebp, edi, [br_vert], 0xFF000000
|
||||
|
||||
call [imp_FillRect]
|
||||
|
||||
|
||||
add esp, 44
|
||||
pop ebx
|
||||
pop esi
|
||||
pop edi
|
||||
pop ebp
|
||||
ret
|
||||
|
||||
align 4
|
||||
|
||||
|
||||
count dd 0
|
||||
|
||||
title db 'Hatches',0
|
||||
|
||||
i_end:
|
||||
|
||||
align 4
|
||||
|
||||
slot rd 1
|
||||
|
||||
br_fd rd 1
|
||||
br_bd rd 1
|
||||
br_cross rd 1
|
||||
br_dcross rd 1
|
||||
br_horz rd 1
|
||||
br_vert rd 1
|
||||
|
||||
sc system_colors
|
||||
|
||||
align 16
|
||||
|
||||
|
||||
rb 2048 ;stack
|
||||
mem:
|
||||
+192
-193
@@ -1,193 +1,192 @@
|
||||
|
||||
include '../../../../proc32.inc'
|
||||
|
||||
struc system_colors
|
||||
{
|
||||
.frame dd ?
|
||||
.grab dd ?
|
||||
.work_dark dd ?
|
||||
.work_light dd ?
|
||||
.grab_text dd ?
|
||||
.work dd ?
|
||||
.work_button dd ?
|
||||
.work_button_text dd ?
|
||||
.work_text dd ?
|
||||
.work_graph dd ?
|
||||
}
|
||||
|
||||
macro _read_file path, offset, data, count
|
||||
{
|
||||
mov eax, dword path
|
||||
mov ebx, dword data
|
||||
mov ecx, dword offset
|
||||
mov edx, dword count
|
||||
|
||||
push 0
|
||||
push 0
|
||||
mov [esp+1], eax
|
||||
push ebx
|
||||
push edx
|
||||
push 0
|
||||
push ecx
|
||||
push 0
|
||||
mov ebx, esp
|
||||
mov eax, 70
|
||||
int 0x40
|
||||
add esp, 28
|
||||
}
|
||||
|
||||
use32
|
||||
|
||||
db 'MENUET01'
|
||||
dd 1
|
||||
dd start
|
||||
dd i_end
|
||||
dd mem
|
||||
dd mem
|
||||
dd 0
|
||||
dd app_path
|
||||
|
||||
include 'pixlib.inc'
|
||||
|
||||
align 4
|
||||
start:
|
||||
fix_cwd app_path
|
||||
|
||||
call load_pxlib
|
||||
test eax, eax
|
||||
jz .fail
|
||||
|
||||
mov eax,48 ; get system colors
|
||||
mov ebx,3
|
||||
mov ecx,sc
|
||||
mov edx,10*4
|
||||
int 0x40
|
||||
|
||||
CreatePixmap 640, 384, ARGB32, PX_MEM_LOCAL ; animation
|
||||
mov [pix_0], eax
|
||||
test eax, eax
|
||||
jz .fail
|
||||
|
||||
CreatePixmap 64, 64, ARGB32, PX_MEM_LOCAL ; saved screen
|
||||
mov [pix_1], eax
|
||||
test eax, eax
|
||||
jz .fail
|
||||
|
||||
CreatePixmap 64, 64, ARGB32, PX_MEM_LOCAL ; back buffer
|
||||
mov [pix_2], eax
|
||||
|
||||
Blit [pix_1], 0,0, SCR_PIXMAP, 0,0, 64,64
|
||||
|
||||
LockPixmap [pix_0]
|
||||
mov ebx, eax
|
||||
_read_file szfile, 128, ebx, 640*384*4
|
||||
UnlockPixmap [pix_0]
|
||||
|
||||
|
||||
.redraw:
|
||||
call draw_window
|
||||
|
||||
.wait_event:
|
||||
|
||||
mov ebx, 2
|
||||
mov eax, 23
|
||||
int 0x40
|
||||
|
||||
|
||||
dec eax ; if event = 1
|
||||
jz .redraw ; jump to redraw handler
|
||||
dec eax ; else if event = 2
|
||||
jz .key ; jump to key handler
|
||||
dec eax
|
||||
jz .button
|
||||
|
||||
Blit [pix_2], 0,0, [pix_1], 0,0, 64,64
|
||||
|
||||
mov eax, [count]
|
||||
inc eax
|
||||
cmp eax, 60
|
||||
jb @F
|
||||
xor eax, eax
|
||||
@@:
|
||||
mov [count], eax
|
||||
|
||||
xor edx, edx
|
||||
mov ebx, 10
|
||||
div ebx
|
||||
|
||||
shl eax, 6
|
||||
shl edx, 6
|
||||
|
||||
TransparentBlit [pix_2], 0,0, [pix_0], edx,eax, 64,64 ,0xFF000000
|
||||
Blit SCR_PIXMAP, 0,0, [pix_2], 0, 0, 64,64
|
||||
|
||||
jmp .wait_event
|
||||
|
||||
.button: ; button event handler
|
||||
mov al, 17 ; get button identifier
|
||||
int 0x40
|
||||
|
||||
cmp ah, 1
|
||||
jne .wait_event ; return if button id != 1
|
||||
.exit:
|
||||
; restore old screen and cleanup
|
||||
|
||||
Blit SCR_PIXMAP, 0,0, [pix_1], 0, 0, 64,64
|
||||
|
||||
DestroyPixmap [pix_2]
|
||||
DestroyPixmap [pix_1]
|
||||
DestroyPixmap [pix_0]
|
||||
.fail:
|
||||
or eax, -1 ; exit application
|
||||
int 0x40
|
||||
.key: ; key event handler
|
||||
mov al, 2 ; get key code
|
||||
int 0x40
|
||||
|
||||
jmp .wait_event
|
||||
|
||||
draw_window:
|
||||
mov eax, 12 ; start drawing
|
||||
mov ebx, 1
|
||||
int 0x40
|
||||
|
||||
xor eax, eax ; create and draw the window
|
||||
mov ebx, 200*65536+200 ; (window_cx)*65536+(window_sx)
|
||||
mov ecx, 200*65536+100 ; (window_cy)*65536+(window_sy)
|
||||
mov edx, [sc.work] ; work area color
|
||||
or edx, 0x33000000 ; & window type 3
|
||||
mov edi, title ; window title
|
||||
int 0x40
|
||||
|
||||
mov eax, 12 ; finish drawing
|
||||
mov ebx, 2
|
||||
int 0x40
|
||||
|
||||
ret
|
||||
|
||||
align 4
|
||||
|
||||
count dd 0
|
||||
|
||||
title db 'Transparent blit',0
|
||||
|
||||
szfile db 'donut.dds',0
|
||||
|
||||
i_end:
|
||||
|
||||
align 4
|
||||
|
||||
pix_0 rd 1
|
||||
pix_1 rd 1
|
||||
pix_2 rd 1
|
||||
|
||||
sc system_colors
|
||||
|
||||
|
||||
align 4
|
||||
|
||||
app_path:
|
||||
|
||||
rb 2048 ; stack
|
||||
mem:
|
||||
|
||||
|
||||
include '../../../proc32.inc'
|
||||
|
||||
struc system_colors
|
||||
{
|
||||
.frame dd ?
|
||||
.grab dd ?
|
||||
.work_dark dd ?
|
||||
.work_light dd ?
|
||||
.grab_text dd ?
|
||||
.work dd ?
|
||||
.work_button dd ?
|
||||
.work_button_text dd ?
|
||||
.work_text dd ?
|
||||
.work_graph dd ?
|
||||
}
|
||||
|
||||
macro _read_file path, offset, data, count
|
||||
{
|
||||
mov eax, dword path
|
||||
mov ebx, dword data
|
||||
mov ecx, dword offset
|
||||
mov edx, dword count
|
||||
|
||||
push 0
|
||||
push 0
|
||||
mov [esp+1], eax
|
||||
push ebx
|
||||
push edx
|
||||
push 0
|
||||
push ecx
|
||||
push 0
|
||||
mov ebx, esp
|
||||
mov eax, 70
|
||||
int 0x40
|
||||
add esp, 28
|
||||
}
|
||||
|
||||
use32
|
||||
|
||||
db 'MENUET01'
|
||||
dd 1
|
||||
dd start
|
||||
dd i_end
|
||||
dd mem
|
||||
dd mem
|
||||
dd 0
|
||||
dd app_path
|
||||
|
||||
include 'pixlib.inc'
|
||||
|
||||
align 4
|
||||
start:
|
||||
fix_cwd app_path
|
||||
|
||||
call load_pxlib
|
||||
test eax, eax
|
||||
jz .fail
|
||||
|
||||
mov eax,48 ; get system colors
|
||||
mov ebx,3
|
||||
mov ecx,sc
|
||||
mov edx,10*4
|
||||
int 0x40
|
||||
|
||||
CreatePixmap 640, 384, ARGB32, PX_MEM_LOCAL ; animation
|
||||
mov [pix_0], eax
|
||||
test eax, eax
|
||||
jz .fail
|
||||
|
||||
CreatePixmap 64, 64, ARGB32, PX_MEM_LOCAL ; saved screen
|
||||
mov [pix_1], eax
|
||||
test eax, eax
|
||||
jz .fail
|
||||
|
||||
CreatePixmap 64, 64, ARGB32, PX_MEM_LOCAL ; back buffer
|
||||
mov [pix_2], eax
|
||||
|
||||
Blit [pix_1], 0,0, SCR_PIXMAP, 0,0, 64,64
|
||||
|
||||
LockPixmap [pix_0]
|
||||
mov ebx, eax
|
||||
_read_file szfile, 128, ebx, 640*384*4
|
||||
UnlockPixmap [pix_0]
|
||||
|
||||
|
||||
.redraw:
|
||||
call draw_window
|
||||
|
||||
.wait_event:
|
||||
|
||||
mov ebx, 2
|
||||
mov eax, 23
|
||||
int 0x40
|
||||
|
||||
|
||||
dec eax ; if event = 1
|
||||
jz .redraw ; jump to redraw handler
|
||||
dec eax ; else if event = 2
|
||||
jz .key ; jump to key handler
|
||||
dec eax
|
||||
jz .button
|
||||
|
||||
Blit [pix_2], 0,0, [pix_1], 0,0, 64,64
|
||||
|
||||
mov eax, [count]
|
||||
inc eax
|
||||
cmp eax, 60
|
||||
jb @F
|
||||
xor eax, eax
|
||||
@@:
|
||||
mov [count], eax
|
||||
|
||||
xor edx, edx
|
||||
mov ebx, 10
|
||||
div ebx
|
||||
|
||||
shl eax, 6
|
||||
shl edx, 6
|
||||
|
||||
TransparentBlit [pix_2], 0,0, [pix_0], edx,eax, 64,64 ,0xFF000000
|
||||
Blit SCR_PIXMAP, 0,0, [pix_2], 0, 0, 64,64
|
||||
|
||||
jmp .wait_event
|
||||
|
||||
.button: ; button event handler
|
||||
mov al, 17 ; get button identifier
|
||||
int 0x40
|
||||
|
||||
cmp ah, 1
|
||||
jne .wait_event ; return if button id != 1
|
||||
.exit:
|
||||
; restore old screen and cleanup
|
||||
|
||||
Blit SCR_PIXMAP, 0,0, [pix_1], 0, 0, 64,64
|
||||
|
||||
DestroyPixmap [pix_2]
|
||||
DestroyPixmap [pix_1]
|
||||
DestroyPixmap [pix_0]
|
||||
.fail:
|
||||
or eax, -1 ; exit application
|
||||
int 0x40
|
||||
.key: ; key event handler
|
||||
mov al, 2 ; get key code
|
||||
int 0x40
|
||||
|
||||
jmp .wait_event
|
||||
|
||||
draw_window:
|
||||
mov eax, 12 ; start drawing
|
||||
mov ebx, 1
|
||||
int 0x40
|
||||
|
||||
xor eax, eax ; create and draw the window
|
||||
mov ebx, 200*65536+200 ; (window_cx)*65536+(window_sx)
|
||||
mov ecx, 200*65536+100 ; (window_cy)*65536+(window_sy)
|
||||
mov edx, [sc.work] ; work area color
|
||||
or edx, 0x33000000 ; & window type 3
|
||||
mov edi, title ; window title
|
||||
int 0x40
|
||||
|
||||
mov eax, 12 ; finish drawing
|
||||
mov ebx, 2
|
||||
int 0x40
|
||||
|
||||
ret
|
||||
|
||||
align 4
|
||||
|
||||
count dd 0
|
||||
|
||||
title db 'Transparent blit',0
|
||||
|
||||
szfile db 'donut.dds',0
|
||||
|
||||
i_end:
|
||||
|
||||
align 4
|
||||
|
||||
pix_0 rd 1
|
||||
pix_1 rd 1
|
||||
pix_2 rd 1
|
||||
|
||||
sc system_colors
|
||||
|
||||
|
||||
align 4
|
||||
|
||||
app_path:
|
||||
|
||||
rb 2048 ; stack
|
||||
mem:
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1
-1
@@ -1,5 +1,5 @@
|
||||
if tup.getconfig("NO_FASM") ~= "" or (tup.getconfig("NO_MSVC") ~= "" and tup.getconfig("NO_GCC") ~= "") 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")
|
||||
|
||||
OBJS = tup.foreach_rule("*.asm", FASM .. " %f %o", "%B.obj")
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1
-1
@@ -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())
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+12
-6
@@ -1,3 +1,9 @@
|
||||
; SPDX-License-Identifier: NOASSERTION
|
||||
;
|
||||
|
||||
; Text encoded with Code Page 866 - Cyrillic
|
||||
|
||||
|
||||
; Программа для преобразования чисел из строки
|
||||
; в формат float, double, а также из 10 или 16 ричного
|
||||
; во float.
|
||||
@@ -14,12 +20,12 @@ use32
|
||||
db 'MENUET01'
|
||||
dd 1,start,i_end,e_end,e_end,0,sys_path
|
||||
|
||||
include '../../../proc32.inc'
|
||||
include '../../../macros.inc'
|
||||
include '../../../KOSfuncs.inc'
|
||||
include '../../../load_lib.mac'
|
||||
include '../../../develop/libraries/box_lib/trunk/box_lib.mac'
|
||||
include '../../../develop/info3ds/info_fun_float.inc'
|
||||
include '../../proc32.inc'
|
||||
include '../../macros.inc'
|
||||
include '../../KOSfuncs.inc'
|
||||
include '../../load_lib.mac'
|
||||
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
|
||||
include '../../develop/info3ds/info_fun_float.inc'
|
||||
include 'lang.inc' ; Language support for locales: ru_RU (CP866), en_US.
|
||||
|
||||
@use_library
|
||||
@@ -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())
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Vendored
File renamed without changes.
File renamed without changes.
@@ -1,3 +1,6 @@
|
||||
; SPDX-License-Identifier: NOASSERTION
|
||||
;
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
; project name: TINYPAD
|
||||
; compiler: flat assembler 1.67.21
|
||||
@@ -24,10 +27,10 @@
|
||||
|
||||
include 'lang.inc'
|
||||
|
||||
include '../../../config.inc' ;for nightbuild
|
||||
include '../../../macros.inc' ; useful stuff
|
||||
include '../../../struct.inc'
|
||||
include '../../../proc32.inc'
|
||||
include '../../config.inc' ;for nightbuild
|
||||
include '../../macros.inc' ; useful stuff
|
||||
include '../../struct.inc'
|
||||
include '../../proc32.inc'
|
||||
|
||||
include 'external/libio.inc'
|
||||
|
||||
@@ -44,7 +47,7 @@ FALSE = 0
|
||||
|
||||
;define __DEBUG__ 1
|
||||
;define __DEBUG_LEVEL__ 1
|
||||
;include '../../../debug-fdo.inc'
|
||||
;include '../../debug-fdo.inc'
|
||||
|
||||
; compiled-in options
|
||||
|
||||
@@ -611,7 +614,7 @@ include 'tp-editor.asm'
|
||||
include 'tp-recode.asm'
|
||||
include 'tp-clipboard.asm'
|
||||
|
||||
include '../../../dll.inc'
|
||||
include '../../dll.inc'
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
__section @DATA ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loaded 100 of 104 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user