kolibrios-gitea/programs/media/paint/trunk/PAINT.ASM

366 lines
12 KiB
NASM
Raw Normal View History

;*********************************
;* *
;* PAINT 0.02 <20><><EFBFBD> MenuetOS *
;* *
;* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E0AEA2><EFBFBD> FASM'<27><> *
;* *
;*********************************
;******************************************************************************
; <20><><EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC> <20><> <20><EFBFBD> <20><><EFBFBD><EFBFBD><ECA5A7> <20><><EFBFBD><EFBFBD><EFBFBD><E0A8A2><EFBFBD> - <20><><EFBFBD> <20><EFBFBD> <20><><EFBFBD><EFBFBD> <20><EFBFBD><E0A8AC>,
; <20> <20><><EFBFBD><EFBFBD><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><><E0A0A1><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><20><><EFBFBD><EFBFBD><20><EFBFBD><E3ADAA><20><><EFBFBD><EFBFBD>,
; <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><E0ACA0><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><E0A5A4><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>⮩,
; <20> <20><><EFBFBD> <20><EFBFBD><E0A5A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD>, <20><><EFBFBD> ⮫쪮 <20><><EFBFBD><E7A8AD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><E1A5AC><EFBFBD><EFBFBD>,
; <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><E0A5AC><EFBFBD><EFBFBD><><E1A4A5><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
; <20><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><E2A8AC><EFBFBD><EFBFBD><E0AEA2>, <20><><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
; <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E3A4AD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E0A0AB> <20><><EFBFBD>⥫쭮 <20><EFBFBD><E0AEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E0AEA2><EFBFBD>
; ᫮<><E1ABAE><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC> <20><EFBFBD><E0A8AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD>, <20> Sniper'<27>, <20><><EFBFBD>
; <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>饬-<2D><> <20><><EFBFBD> <20> <20><><EFBFBD><E1A0AB><EFBFBD>.
; <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><E7A5AD> <20>ᬠ!
; <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E3A1AD>, ivan-yar@bk.ru
;******************************************************************************
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E5AEA4><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
include 'macros.inc'
;******************************************************************************
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
meos_app_start
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
code
mov eax,40 ; ᮮ<><20><><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><><E1AEA1><EFBFBD><EFBFBD> <20><EFBFBD> <20><><EFBFBD><E0A0A1><EFBFBD><EBA2A0>
mov ebx,0100101b ; <20><>᪠ ᮡ<>⨩ - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1AEA2> (1) + <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (3) + <20><><EFBFBD><EFBFBD> (6
int 0x40 ; <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EBA2A0> <20><><EFBFBD><EFBFBD><E2A5AC><EFBFBD> <20><EFBFBD><E3ADAA><EFBFBD>
mov [workarea.cx],10 ; <20><><EFBFBD><EFBFBD><E0A4A8><EFBFBD><EFBFBD><>祩 (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
mov [workarea.cy],45 ; <20><><EFBFBD> <20><><EFBFBD><E1AEA2><EFBFBD><EFBFBD>
red:
call draw_window ; <20><><EFBFBD><EFBFBD><EBA2A0> <20><><EFBFBD><EFBFBD><E6A5A4><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E1AEA2> <20><><EFBFBD><EFBFBD>
still: ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
mov eax,10 ; <20><EFBFBD><E3ADAA><EFBFBD> 10 - <20><><EFBFBD><EFBFBD><EFBFBD><><E1AEA1><EFBFBD><EFBFBD>; <20>ணࠬ<E0AEA3><E0A0AC> <20><><EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>
int 0x40 ; ᫥<><E1ABA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><EFBFBD> <20><EFBFBD><EBAFAE><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD> <20><><EFBFBD>, <20><><EFBFBD><EFBFBD>
; <20><> <20><EFBFBD><E0AEA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><>
; ⥯<><E2A5AF><EFBFBD><><E0A5A3><EFBFBD><EFBFBD> eax ᮤ<><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><><E1AEA1><EFBFBD><EFBFBD>
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E0A5A4> <20><EFBFBD><E0A0A2><EFBFBD> <20><><EFBFBD> <20><> <20><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><20><><EFBFBD><EFBFBD>ﬨ, <20><EFBFBD> <20><EFBFBD><EBA7A2><EFBFBD>
; <20><EFBFBD><E3A6AD> <20><><EFBFBD><E0A0A1>
cmp eax,1 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1AEA2><EFBFBD> <20><><EFBFBD><EFBFBD> ?
je red ; <20>᫨ ॣ<><E0A5A3><EFBFBD><EFBFBD> eax ࠢ<><E0A0A2> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><> <20><><EFBFBD><EFBFBD><EFBFBD><E5AEA4> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> red
cmp eax,3 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ?
je button
cmp eax,6 ; <20><><EFBFBD><EFBFBD>?
je mouse
jmp still ; <20><20><EFBFBD><E0AEA8>諮 ᮡ<>⨥, <20><><EFBFBD><EFBFBD><20><> <20><> <20><><EFBFBD><E0A0A1><EFBFBD><EBA2A0>,
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E9A0A5><EFBFBD> <20> <20><><EFBFBD><><E6A8AA>, <20><><EFBFBD><EFBFBD><><E2A0AA><EFBFBD> <20><><EFBFBD><EFBFBD>
; <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>! <20>.<2E>. <20><20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><>
; <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E8ADAE> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
;******************************************************************************
button: ; <20><><EFBFBD><E0A0A1><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC>
mov eax,17 ; <20><EFBFBD><E3ADAA><EFBFBD> N17 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E4A8AA><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
int 0x40
; ⥯<><E2A5AF><EFBFBD> <20><><E0A5A3><EFBFBD><EFBFBD><EFBFBD> ah ᮤ<><EFBFBD><E0A6A8><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E4A8AA><EFBFBD><EFBFBD>.
shr eax,8 ; ah -> al (ᤢ<><E1A4A2> <20><> 8 <20><><EFBFBD> <20><><EFBFBD>)
dec al ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E4A8AA><EFBFBD><EFBFBD>_<EFBFBD><5F><EFBFBD><EFBFBD><EFBFBD><EFBFBD>--;
jnz .noclose ; <20>᫨ १<><E0A5A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><E0A5A4><EFBFBD><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><E0A0A2> <20><><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EBA2A0><EFBFBD><EFBFBD>
; <20><><EFBFBD><EFBFBD><EFBFBD> - <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> noclose
or eax,-1 ; <20><><20><> <20>ணࠬ<E0AEA3><E0A0AC>
int 0x40
.noclose:
; <20><20><> <20><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E4A8AA><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><><E0A0A2> <20><><EFBFBD><EFBFBD>...
; ⥯<><E2A5AF><EFBFBD> <20> <20><><EFBFBD> <20> eax ᮤ<><EFBFBD><E0A6A8><EFBFBD> (<28><><EFBFBD><EFBFBD><EFBFBD> 梥⭮<E6A2A5> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - 1),
; <20>.<2E> <20><><EFBFBD> 1, <20><><EFBFBD> 2, ... ,<2C><><EFBFBD> 5
; 㬥<><E3ACA5><20><> 1:
dec eax
; <20><><EFBFBD> <20><><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> eax <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><E1ABAE> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> colors+eax*4
; <20><><EFBFBD> colors - ᬥ饭<E1ACA5><E9A5AD> <20><>⪨ colors, <20><><20><><EFBFBD><EFBFBD><20><><EFBFBD><EFBFBD> <20><><EFBFBD><E1ABA5><EFBFBD><EFBFBD>⥫쭮<E2A5AB><ECADAE><EFBFBD>
; 梥⮢, eax*4 - <20><><EFBFBD><EFBFBD><EFBFBD><><E6A2A5>, 㬭<><E3ACAD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> 4, <20>.<2E>. <20><> <20><><EFBFBD><EFBFBD><> <20><EFBFBD>
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>.
mov eax,[colors+eax*4]
; ⥯<><E2A5AF><EFBFBD> <20><> <20><><EFBFBD><E2A0AD><EFBFBD><EFBFBD><>, ᮤ<>ঠ騩<E0A6A0><E9A8A9> <20><><E0A5A3><EFBFBD><EFBFBD><EFBFBD> eax <20><><EFBFBD> <20><EFBFBD><E1ADAE><EFBFBD><EFBFBD>:
mov [active_color],eax
; <20><> <20><><EFBFBD>, ᮡ<><EFBFBD><E2A2A5><EFBFBD>, <20> <20><><EFBFBD>, <20><><EFBFBD> <20><> <20><><EFBFBD> <20><EFBFBD><E0A5A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ;)
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><><E6A8AA> <20><><EFBFBD>⪨ ᮡ<>
jmp still
;******************************************************************************
mouse: ; <20><><EFBFBD><E0A0A1><20><><EFBFBD><EFBFBD>
mov eax,37 ; ᭠砫<E1ADA0> <20><><EFBFBD><EFBFBD>稬 ⥪<><20><><EFBFBD><EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
mov ebx,1
int 0x40
mov ebx,eax ; <20><EFBFBD>ࠧ㥬 <20><>
shr eax,16 ; eax=x;
and ebx,0xffff ; ebx=y;
cmp ebx,22
jb save_canvas
sub eax,[workarea.cx] ; x-=[workarea.cx]
cmp eax,0 ; <20><20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
jle .not_pressed ; <20><><EFBFBD> <20><> <20><><EFBFBD>
cmp eax,[workarea.sx] ; <20><20><><EFBFBD><EFBFBD> <20><EFBFBD><E0A0A2>...
jae .not_pressed
sub ebx,[workarea.cy]
cmp ebx,0 ; ...<2E><><EFBFBD><EFBFBD>...
jle .not_pressed
cmp ebx,[workarea.sy] ; ...<2E><><EFBFBD><EFBFBD>...
jae .not_pressed
; <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?
mov eax,37
mov ebx,2
int 0x40
; <20><20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28>.<2E>. eax = 1), <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
cmp eax,1
je .leftbtn
.not_pressed:
; <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><20><><EFBFBD><EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20> <20><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><><E1AEA1><EFBFBD><EFBFBD>
mov [mouse_pressed],0 ; <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
mov eax,37 ; <20><><EFBFBD><EFBFBD><20><><EFBFBD><EFBFBD><E0A4A8><EFBFBD><EFBFBD>
mov ebx,1
int 0x40
mov ebx,eax
shr eax,16
and ebx,0xffff
mov [old_x],eax ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>
mov [old_y],ebx
jmp still
.leftbtn:
; <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!
mov [mouse_pressed],1
; <20><><EFBFBD><EFBFBD><20><><EFBFBD><EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> (<28><EFBFBD><E2ADAE>⥫쭮 <20><><EFBFBD><EFBFBD>)
mov eax,37 ; <20><EFBFBD><E3ADAA><EFBFBD> 37 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
mov ebx,1 ; <20><><EFBFBD><EFBFBD><EFBFBD><E3ADAA><EFBFBD> 1
int 0x40
; <20><><EFBFBD><E0A5A4><EFBFBD><EFBFBD><EFBFBD> <20><> ⠪, <20><EFBFBD> <20><><EFBFBD> <20><20><><E0A0A7><EFBFBD><><E0A5A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20>.<2E>. eax <20> ebx
mov ebx,eax
shr eax,16
and ebx,0xffff
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E2AEA2> <20><><EFBFBD><E0A0AC><EFBFBD><EFBFBD> <20><><EFBFBD> <20>㭪樨 <20><><EFBFBD><E1AEA2><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
mov ecx,[old_x] ; <20><><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><E0A4A8><EFBFBD><EFBFBD>
mov edx,[old_y]
mov [old_x],eax ; ⥯<><E2A5AF><EFBFBD> <20><><EFBFBD><EFBFBD><E0A0AD><><20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
mov [old_y],ebx
shl ecx,16 ; <20> <20><><EFBFBD><EFBFBD><><E1ABAE> <20><><EFBFBD><E7A0AB><EFBFBD><EFBFBD> (⥪<>騥) <20><><EFBFBD><EFBFBD><E0A4A8><EFBFBD><EFBFBD>
shl edx,16
add eax,ecx ; <20> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><E1ABAE> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20>.<2E>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
add ebx,edx
mov ecx,ebx ; <20><><EFBFBD><EFBFBD><EFBFBD>塞 ॣ<><E0A5A3><EFBFBD><EFBFBD><EFBFBD> ⠪, <20><><EFBFBD> <20><><EFBFBD> <20><EFBFBD> 38 <20>㭪樨
mov ebx,eax
mov eax,38 ; <20><><EFBFBD><EFBFBD><EFBFBD> <20>㭪樨 <20> eax
mov edx,[active_color] ; <20> edx 梥<>
int 0x40
;  - <20><><EFBFBD><EFBFBD><E0AEA1><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><E2A0A2><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><E7A5AD> (00090001)
mov edi,0x00010001 ; <20><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20>뫠 ᫨誮<E1ABA8><><E2AEAD><EFBFBD>,
add ebx,edi ; <20><><EFBFBD><EFBFBD><EFBFBD><20><EFBFBD> <20><><EFBFBD> 3!
int 0x40
add ecx,edi
int 0x40
sub ebx,edi
int 0x40
sub ebx,edi ; <20><> <20> <20><EFBFBD><><EFBFBD><E0A5AB><EFBFBD> ᮢᥬ <20><><EFBFBD><EFBFBD><EFBFBD>,
int 0x40 ; <20><><EFBFBD><EFBFBD><EFBFBD><20><><EFBFBD> 5!
sub ecx,edi
int 0x40
sub ecx,edi
int 0x40
add ebx,edi
int 0x40
add ebx,edi
int 0x40
jmp still
;******************************************************************************
save_canvas:
mov eax,[process.x_size]
add eax,[workarea.cx]
mov ebx,[process.y_size]
add ebx,[workarea.cy]
jmp still
;******************************************************************************
; *********************************************
; ******* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> *******
; *********************************************
draw_window:
mov eax,48 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
mov ebx,3
mov ecx,sc
mov edx,sizeof.system_colors
int 0x40
mov eax,12 ; <20><EFBFBD><E3ADAA><EFBFBD> 12: ᮮ<><E1AEAE><EFBFBD><EFBFBD><EFBFBD> <20><> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><E1AEA2> <20><><EFBFBD><EFBFBD>
mov ebx,1 ; 1, <20><><EFBFBD><E7A8AD><EFBFBD> <20><><EFBFBD><E1AEA2><EFBFBD>
int 0x40
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
mov eax,0 ; <20><EFBFBD><E3ADAA><EFBFBD> 0 : <20><><EFBFBD><E0A5A4><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><E1AEA2><EFBFBD> <20><><EFBFBD><EFBFBD>
mov ebx,100*65536+400 ; [x <20><><EFBFBD><EFBFBD><EFBFBD>] *65536 + [x ࠧ<><E0A0A7><EFBFBD>]
mov ecx,100*65536+300 ; [y <20><><EFBFBD><EFBFBD><EFBFBD>] *65536 + [y ࠧ<><E0A0A7><EFBFBD>]
mov edx,[sc.work] ; 梥<><><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> RRGGBB,8->color gl
or edx,0x02000000
mov esi,[sc.grab] ; 梥<> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> RRGGBB,8->color gl
or esi,0x80000000
mov edi,[sc.frame] ; 梥<><><E0A0AC> RRGGBB
int 0x40
mov eax,9 ; <20><><EFBFBD><EFBFBD><20><><EFBFBD><EFBFBD><EFBFBD><E0ACA0><EFBFBD> <20><>
mov ebx,process
mov ecx,-1
int 0x40
mov eax,[process.x_size] ; <20><><EFBFBD><EFBFBD><EFBFBD><><E0A0A7><EFBFBD><><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
add eax,-20 ; (<28><><E0A0A7><EFBFBD> <20><><EFBFBD><EFBFBD> - 20)
mov [workarea.sx],eax ;
mov eax,[process.y_size] ;
add eax,-60 ; (<28><><E0A0A7><EFBFBD> - 60)
mov [workarea.sy],eax ;
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
mov eax,4 ; <20><EFBFBD><E3ADAA><EFBFBD> 4 : <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><><E2A5AA>
mov ebx,8*65536+8 ; [x] *65536 + [y]
mov ecx,[sc.grab_text] ; 梥<>
or ecx,0x10000000 ; <20><><EFBFBD><EFBFBD><EFBFBD>
mov edx,header ; <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>
mov esi,header_len ; <20> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>
int 0x40
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
mov eax,8 ; <20><EFBFBD><E3ADAA><EFBFBD> 8 : <20><><EFBFBD><E0A5A4><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><E1AEA2><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
; mov ebx,(300-19)*65536+12 ; [x <20><><EFBFBD><EFBFBD><EFBFBD>] *65536 + [x ࠧ<><E0A0A7><EFBFBD>]
mov ebx,[process.x_size]
add ebx,-19
shl ebx,16
add ebx,12
mov ecx,5*65536+12 ; [y <20><><EFBFBD><EFBFBD><EFBFBD>] *65536 + [y ࠧ<><E0A0A7><EFBFBD>]
mov edx,1 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E4A8AA><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
mov esi,[sc.grab_button] ; 梥<> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> RRGGBB
int 0x40
cmp [process.y_size],80
jb .finish
; ᮧ<><E1AEA7><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><EBA1AE><><E6A2A5>:
mov ebx,10*65536+10 ; <20><>砫쭠<E7A0AB> x <20><><EFBFBD><EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><><E0A0A7><EFBFBD>
mov ecx,27*65536+10 ; <20><>砫쭠<E7A0AB> y <20><><EFBFBD><EFBFBD><E0A4A8><EFBFBD><EFBFBD> & size
.new_button:
inc edx ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E4A8AA><EFBFBD><EFBFBD>++;
mov esi,[btn_colors-8+edx*4] ; 梥<> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
int 0x40 ; <20><EFBFBD><E2A0A2> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
add ebx,12*65536 ; ᫥<><E1ABA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><E0A0A2> <20><> 12
cmp edx,9 ; <20><EFBFBD><E0A0A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD> edx (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E4A8AA><EFBFBD><EFBFBD>) <20> 9
jbe .new_button ; <20><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><><E0A0A2> -> <20><><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
mov eax,13 ; <20><><EFBFBD>⨬ "宫<><E5AEAB>" - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
mov ebx,[workarea.cx]
mov ecx,[workarea.cy]
shl ebx,16
shl ecx,16
add ebx,[workarea.sx]
add ecx,[workarea.sy]
mov edx,0xffffff
int 0x40
.finish:
mov eax,12 ; ᮮ<><EFBFBD> <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E8A5AD> <20><><EFBFBD><EFBFBD><EFBFBD><E1AEA2> <20><><EFBFBD><EFBFBD>
mov ebx,2
int 0x40
ret
;******************************************************************************
; <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><E6A8A0><EFBFBD><EFBFBD><EFBFBD><E0AEA2><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
; <20><20><><EFBFBD> <20><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> "<22><><EFBFBD><EFBFBD><E6A8A0><EFBFBD><EFBFBD><EFBFBD><E0AEA2><EFBFBD><EFBFBD><EFBFBD>", <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
; <20><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><E1A2AE><EFBFBD> <20><>砫쭮<E7A0AB> <20><><EFBFBD><EFBFBD><E7A5AD>
data
header: ; <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
db 'PAINT v0.2 for MenuetOS'
header_len = $ - header ; <20> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>
mouse_pressed db 0 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EBA2A0>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><20><><EFBFBD><EFBFBD> <20> <20><EFBFBD><E0A5A4><EFBFBD><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
; 梥<><E6A2A5> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
btn_colors:
dd 0xdddddd ; white
dd 0x444444 ; black
dd 0x00dd00 ; green
dd 0x0000dd ; blue
dd 0xdd0000 ; red
dd 0xdd00dd ; magenta
dd 0xdddd00 ; yellow
dd 0x00dddd ; cyan
dd 0x559955 ; warm green
; 梥<><E6A2A5> <20><><EFBFBD><EFBFBD><EFBFBD> (<28><20><> <20><><EFBFBD><EFBFBD>, <20><><EFBFBD> <20><><E6A2A5> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
colors:
dd 0xffffff ; <20><><EFBFBD><EFBFBD><EFBFBD>
dd 0x000000 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
dd 0x00ff00 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
dd 0x0000ff ; ᨭ<><E1A8AD>
dd 0xff0000 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
dd 0xff00ff ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
dd 0xffff00 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
dd 0x00ffff ; <20><><EFBFBD><EFBFBD>
dd 0x77bb77 ; ⥯<><E2A5AF><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
;******************************************************************************
; <20> <20><><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><E7A8AD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E6A8A0><EFBFBD><EFBFBD><EFBFBD><E0AEA2><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20>.<2E>.
; <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><E7A5AD> <20><> <20><><EFBFBD><EFBFBD><E1A2AE><EFBFBD>. <20> <20>⫨稥 <20><> <20><><EFBFBD><EFBFBD>., <20><><><E3A2A5><EFBFBD><E7A8A2><EFBFBD><><E0A0A7><EFBFBD>
; 䠩<><E4A0A9>
udata
active_color dd ? ; <20><><EFBFBD><E2A8A2><EFBFBD><>
old_x dd ? ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
old_y dd ?
workarea: ; <20><><EFBFBD><EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><><E0A0A7><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
.cx dd ? ; c - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
.cy dd ?
.sx dd ? ; s - ࠧ<><E0A0A7><EFBFBD><EFBFBD>
.sy dd ?
sc system_colors ; <20><><EFBFBD><EFBFBD><E2A5AC><EFBFBD><><E6A2A5>
process process_information ; <20><><EFBFBD><EFBFBD><EFBFBD><E0ACA0><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
restflag dd ?
canvas rb 800*600*3
meos_app_end