2013-05-09 20:49:02 +02:00
|
|
|
|
;*********************************
|
|
|
|
|
;* *
|
|
|
|
|
;* 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>
|
2016-02-07 20:54:43 +01:00
|
|
|
|
include '../../../macros.inc'
|
2013-05-09 20:49:02 +02:00
|
|
|
|
|
|
|
|
|
;******************************************************************************
|
|
|
|
|
|
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2016-02-07 20:54:43 +01:00
|
|
|
|
use32
|
|
|
|
|
org 0x0
|
|
|
|
|
db 'MENUET01' ; 8 byte id
|
|
|
|
|
dd 0x01 ; title version
|
|
|
|
|
dd START ; start of code
|
|
|
|
|
dd I_END ; size of image
|
|
|
|
|
dd E_END ; memory for app
|
|
|
|
|
dd E_END ; esp
|
|
|
|
|
dd 0x0,0x0 ; I_Param , I_Icon
|
|
|
|
|
|
2013-05-09 20:49:02 +02:00
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
2016-02-07 20:54:43 +01:00
|
|
|
|
START:
|
2013-05-09 20:49:02 +02:00
|
|
|
|
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>
|
|
|
|
|
|
2016-02-07 20:54:43 +01:00
|
|
|
|
mov [workarea.cx],5 ; <20><><EFBFBD>न<EFBFBD><E0A4A8><EFBFBD><EFBFBD> ࠡ<>祩 (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov [workarea.cy],30 ; <20><><EFBFBD> <20><>ᮢ<EFBFBD><E1AEA2><EFBFBD><EFBFBD>
|
2013-05-09 20:49:02 +02:00
|
|
|
|
|
|
|
|
|
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>)
|
2016-02-07 20:54:43 +01:00
|
|
|
|
mcall 37,1 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ﭨ<EFBFBD> <20><><EFBFBD><EFBFBD>
|
2013-05-09 20:49:02 +02:00
|
|
|
|
|
|
|
|
|
; <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:
|
2016-02-07 20:54:43 +01:00
|
|
|
|
mov eax,[proc_info.box.width]
|
2013-05-09 20:49:02 +02:00
|
|
|
|
add eax,[workarea.cx]
|
2016-02-07 20:54:43 +01:00
|
|
|
|
mov ebx,[proc_info.box.height]
|
2013-05-09 20:49:02 +02:00
|
|
|
|
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:
|
|
|
|
|
|
2016-02-07 20:54:43 +01:00
|
|
|
|
mcall 48,3,sc,sizeof.system_colors ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mcall 12, 1 ; <20><>砫<EFBFBD> <20><><EFBFBD><EFBFBD>ᮢ<EFBFBD><E1AEA2> <20><><EFBFBD><EFBFBD>
|
|
|
|
|
mov edx, [sc.work]
|
|
|
|
|
or edx, 0x33000000
|
|
|
|
|
mcall 0, (100 shl 16)+400, (100 shl 16)+300, , , title ; <20><><EFBFBD>㥬 <20><><EFBFBD><EFBFBD>
|
|
|
|
|
mcall 12, 1
|
|
|
|
|
|
|
|
|
|
mcall 9,proc_info,-1 ; <20><><EFBFBD><EFBFBD>稬 <20><><EFBFBD><EFBFBD>ଠ<EFBFBD><E0ACA0><EFBFBD> <20> <><E1A2AE> <20><>⮪<EFBFBD>
|
|
|
|
|
|
|
|
|
|
mov eax,[proc_info.box.width] ; <20><><EFBFBD><EFBFBD>ந<EFBFBD> ࠧ<><E0A0A7><EFBFBD> ࠡ<>祩 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
sub eax,20 ; (<28> ࠧ<><E0A0A7><EFBFBD> <20><><EFBFBD><EFBFBD> - 20)
|
|
|
|
|
mov [workarea.sx],eax
|
|
|
|
|
mov eax,[proc_info.box.height]
|
|
|
|
|
sub eax,63 ; (<28> ࠧ<><E0A0A7><EFBFBD> - 63)
|
|
|
|
|
mov [workarea.sy],eax
|
|
|
|
|
|
|
|
|
|
cmp [proc_info.box.height],80
|
2013-05-09 20:49:02 +02:00
|
|
|
|
jb .finish
|
2016-02-07 20:54:43 +01:00
|
|
|
|
|
|
|
|
|
mov eax, 8
|
|
|
|
|
mov edx, 1
|
2013-05-09 20:49:02 +02:00
|
|
|
|
; ᮧ<><E1AEA7><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>롮<EFBFBD><EBA1AE> 梥<><E6A2A5>:
|
2016-02-07 20:54:43 +01:00
|
|
|
|
mov ebx,10*65536+15 ; <20><>砫쭠<E7A0AB> x <20><><EFBFBD>न<EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20> ࠧ<><E0A0A7><EFBFBD>
|
|
|
|
|
mov ecx, 7*65536+15 ; <20><>砫쭠<E7A0AB> y <20><><EFBFBD>न<EFBFBD><E0A4A8><EFBFBD><EFBFBD> & size
|
2013-05-09 20:49:02 +02:00
|
|
|
|
.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>
|
2016-02-07 20:54:43 +01:00
|
|
|
|
add ebx,18*65536 ; <><E1ABA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ࠢ<EFBFBD><E0A0A2> <20><> 12
|
2013-05-09 20:49:02 +02:00
|
|
|
|
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
|
2016-02-07 20:54:43 +01:00
|
|
|
|
mcall 13
|
2013-05-09 20:49:02 +02:00
|
|
|
|
|
|
|
|
|
.finish:
|
|
|
|
|
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>
|
|
|
|
|
|
2016-02-07 20:54:43 +01:00
|
|
|
|
;data
|
2013-05-09 20:49:02 +02:00
|
|
|
|
|
2016-02-07 20:54:43 +01:00
|
|
|
|
title db 'Simple Paint v0.3',0
|
|
|
|
|
|
2013-05-09 20:49:02 +02:00
|
|
|
|
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>
|
|
|
|
|
|
2016-02-07 20:54:43 +01:00
|
|
|
|
I_END:
|
2013-05-09 20:49:02 +02:00
|
|
|
|
|
|
|
|
|
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>
|
2016-02-07 20:54:43 +01:00
|
|
|
|
proc_info process_information ; <20><><EFBFBD><EFBFBD>ଠ<EFBFBD><E0ACA0><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2013-05-09 20:49:02 +02:00
|
|
|
|
|
|
|
|
|
restflag dd ?
|
|
|
|
|
canvas rb 800*600*3
|
|
|
|
|
|
2016-02-07 20:54:43 +01:00
|
|
|
|
E_END:
|