mirror of
https://github.com/KolibriOS/kolibrios.git
synced 2024-12-03 22:01:55 +03:00
c0d55c2dac
git-svn-id: svn://kolibrios.org@4962 a494cfbc-eb01-0410-851d-a64ba20cac60
1361 lines
54 KiB
NASM
1361 lines
54 KiB
NASM
;#___________________________________________________________________________________________________
|
||
;****************************************************************************************************|
|
||
; Program Palitra (c) Sergei Steshin (Akyltist) |
|
||
;----------------------------------------------------------------------------------------------------|
|
||
;; Charset:DOS-866 Font:Courier New Size:9pt |
|
||
;.....................................................................................................
|
||
;; compiler: FASM 1.69.31 |
|
||
;; version: 0.3.0 |
|
||
;; last update: 08/11/2012 |
|
||
;; e-mail: dr.steshin@gmail.com |
|
||
;.....................................................................................................
|
||
;; History: |
|
||
;; 0.1.0 - <20>¥à¢ ï ¢¥àá¨ï ¯à®£à ¬¬ë. |
|
||
;; 0.2.0 - ˆá¯à ¢«¥® ¯®¯ ¤ ¨¥ ¢ á¥âªã, ¡¥à¥âáï ¡«¨¦ ©è¨© ¯® ¤¨ £® «¨ ¯¨ªá¥«ì. |
|
||
;; - „®¡ ¢«¥ë ¯®«§ãª¨, ¤«ï ॣ㫨஢ ¨ï rgb á®áâ ¢«ïîé¨å 梥⠨ ¢ë¢®¤ íâ¨å á®áâ ¢«ïîé¨å. |
|
||
;; - “¡à ¢ë¢®¤ 梥⠢ ¡¨ ஬ ¢¨¤¥ (¯®ª § ¥ ¤®¡®áâìî ¨ ¥ ªâã «ì®áâìî). |
|
||
;; - Œ¥«ª ï ª®á¬¥â¨ª . |
|
||
;; 0.3.0 - „®¡ ¢«¥® ¯¥à¥ª«î票¥ ¢¨¤®¢ 梥⮢ëå á奬 (ª®¯ª NEXT) |
|
||
;; - “«ãçè¥ë ¯®«§ãª¨, ¯à®¨§¢®¤¨âáï ®¡à ¡®âª ¦ â¨ï à冷¬ á ¯®«§ãª®¬. |
|
||
;; - —¨á«® á¥â®ª ¢ 梥⮢®© á奬¥ 㬥ì襮 á 6 ¤® 4 (ªà â®áâì 256, ¨ ç¥ ¤ã¡«¨à®¢ ¨¥ 梥â ).|
|
||
;; - Œ¥«ª ï ª®á¬¥â¨ª . |
|
||
;; 0.4.0 - „®¡ ¢«¥® ¯¥à¥ª«î票¥ ¬¥¦¤ã ¤¢ã¬ï 梥⠬¨ |
|
||
;; - „®¡ ¢«¥ ¯®«§ã®ª ॣ㫨஢ ¨ï ¯à®§à ç®á⨠(¡¥§ ¢¨§ã «¨§ 樨). |
|
||
;; - „®¡ ¢«¥® ¢ëà ¢¨¢ ¨¥ § 票© rgba ¯® æ¥âàã, ¢ § ¢¨á¨¬®á⨠®â ¤«¨ë. |
|
||
;; - Š®á¬¥â¨ç¥áª¨¥ ¯à ¢ª¨. |
|
||
;; - <20>¥¡®«ìè ï ®¯â¨¬¨§ æ¨ï. |
|
||
;; 0.5.0 - „®¡ ¢«¥ ª®¯ª ᬥë ä® à ¡®ç¥£® á⮫ (®â Leency). |
|
||
;; - „®¡ ¢«¥® ¨§¬¥¥¨¥ ä® à ¡®ç¥£® á⮫ £à ¤¨¥â®© § «¨¢ª®©. |
|
||
;; - Š®á¬¥â¨ç¥áª¨¥ ¯à ¢ª¨. |
|
||
;; - <20>¥¡®«ìè ï ¤¥®¯â¨¬¨§ æ¨ï. |
|
||
;; 0.6.0 - „®¡ ¢«¥ ¢®§¬®¦®áâì § ¯ãáª á ¯ à ¬¥âà ¬¨ |
|
||
;; - „®¡ ¢«¥ ०¨¬ H (hidden) ¯à®¨§¢®¤¨â § ¬¥ã ä® à ¡®ç¥£® á⮫ £à ¤¨¥â®© § «¨¢ª®©. |
|
||
;; - <20>®«ìè ï ¤¥®¯â¨¬¨§ æ¨ï. |
|
||
;; 0.7.0 - „®¡ ¢«¥ ¯¨¯¥âª - ¢ë¡®à á।îî ª®¯ªã ¬ëè¨ |
|
||
;; 0.7.5 - <20> ¦ ⨥ ¯à ¢®© ª« ¢¨è¥© ¬ëè¨ ï祩ªã á 梥⮬ ãáâ ¢«¨¢ ¥â ¥ ®á®¢®©, ¤®¯®«. 梥â |
|
||
;; - “¬¥ì襮 ¬¥àæ ¨¥ ¯à¨ à ¡®â¥ ¯¨¯¥âª¨ |
|
||
;; 0.7.6 - „®¡ ¢«¥ ०¨¬ B, ª®â®àë© ¯à®¨§¢®¤¨â § ¬¥ã ä® à ¡®ç¥£® á⮫ è㬮© § «¨¢ª®© (e-andrew)|
|
||
;.....................................................................................................
|
||
;; All rights reserved. |
|
||
;; |
|
||
;; Redistribution and use in source and binary forms, with or without modification, are permitted |
|
||
;; provided that the following conditions are met: |
|
||
;; * Redistributions of source code must retain the above copyright notice, this list of |
|
||
;; conditions and the following disclaimer. |
|
||
;; * Redistributions in binary form must reproduce the above copyright notice, this list of |
|
||
;; conditions and the following disclaimer in the documentation and/or other materials |
|
||
;; provided with the distribution. |
|
||
;; * Neither the name of the <organization> nor the names of its contributors may be used to |
|
||
;; endorse or promote products derived from this software without specific prior written |
|
||
;; permission. |
|
||
;; |
|
||
;; THIS SOFTWARE IS PROVIDED BY Sergei Steshin ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, |
|
||
;; INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A |
|
||
;; PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY DIRECT, |
|
||
;; INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED |
|
||
;; TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
|
||
;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
|
||
;; LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
|
||
;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|
||
;....................................................................................................|
|
||
|
||
|
||
;#___________________________________________________________________________________________________
|
||
;****************************************************************************************************|
|
||
; ‡€ƒŽ‹Ž‚ŽŠ ˆ‘<CB86>Ž‹<C5BD>Ÿ…ŒŽƒŽ ”€‰‹€ <20><>ˆ‹Ž†…<E280A0>ˆŸ „‹Ÿ ŠŽ‹ˆ<E280B9><CB86>ˆ Ž‘ |
|
||
;----------------------------------------------------------------------------------------------------/
|
||
use32
|
||
org 0x0
|
||
db 'MENUET01'
|
||
dd 0x01
|
||
dd START
|
||
dd I_END
|
||
dd I_MEM
|
||
dd I_MEM
|
||
dd params
|
||
dd 0x0
|
||
|
||
include '../../../macros.inc'
|
||
include '../../../proc32.inc'
|
||
|
||
WIN_W equ 295 ; è¨à¨ ®ª
|
||
WIN_H equ 195 ; ¢ëá®â ®ª
|
||
WIN_X equ 250 ; ª®®à¤¨ â å ®ª
|
||
WIN_Y equ 190 ; ª®®à¤¨ â ã ®ª
|
||
|
||
panel:
|
||
file "panel.raw"
|
||
|
||
START:
|
||
mcall 68,11 ; ¨¨æ¨ «¨§ æ¨ï ªãç¨
|
||
mcall 40,0x27 ; ãáâ ¢«¨¢ ¥¬ ¬ áªã ᮡë⨩
|
||
include 'params_init.inc' ; ®¡à ¡®âª ¯ à ¬¥â஢ ª®¬ ¤®© áâப¨
|
||
|
||
;#___________________________________________________________________________________________________
|
||
;****************************************************************************************************|
|
||
; Ž‘<C5BD>Ž‚<C5BD>Ž‰ –ˆŠ‹ <20><>Žƒ<C5BD>€ŒŒ› - Ž<><C5BD>€<EFBFBD>Ž’Š€ ‘Ž<E28098>›’ˆ‰ |
|
||
;----------------------------------------------------------------------------------------------------/
|
||
red:
|
||
call draw_main ; ¢ë§ë¢ ¥¬ ¯¥à¥à¨á®¢ªã ®ª ¯à¨«®¦¥¨ï
|
||
still:
|
||
mcall 10 ; äãªæ¨ï 10 - ¦¤ âì ᮡëâ¨ï
|
||
cmp eax,1 ; ¯¥à¥à¨á®¢ âì ®ª® ?
|
||
je red ; ¥á«¨ ¤ - ¬¥âªã red
|
||
cmp eax,2 ; ¦ â ª« ¢¨è ?
|
||
je key ; ¥á«¨ ¤ - key
|
||
cmp eax,3 ; ¦ â ª®¯ª ?
|
||
je button ; ¥á«¨ ¤ - button
|
||
cmp eax,6 ; ᮡë⨥ ®â ¬ëè¨ ¢¥ ®ª
|
||
je mouse ; ¥á«¨ ¤ - button
|
||
jmp still ; ¥á«¨ ¤à㣮¥ ᮡë⨥ - ¢ ç «® 横«
|
||
;end_still
|
||
|
||
key: ; ¦ â ª« ¢¨è ª« ¢¨ âãà¥
|
||
mcall 2 ; äãªæ¨ï 2 - áç¨â âì ª®¤ ᨬ¢®« (¢ ah) (âãâ ¢ ¯à¨æ¨¯¥ ¥ 㦠)
|
||
jmp still ; ¢¥àãâìáï ª ç «ã 横«
|
||
;end_key
|
||
|
||
mouse:
|
||
cmp [renmode],2
|
||
jne left
|
||
call cyrcle_draw
|
||
jmp center
|
||
left:
|
||
mcall 37,2
|
||
cmp al,1b
|
||
jne right
|
||
mov [mouse_f],1
|
||
jmp still
|
||
right:
|
||
cmp al,10b
|
||
jne still
|
||
mov [mouse_f],2
|
||
jmp still
|
||
center:
|
||
mcall 37,2
|
||
cmp al,100b
|
||
jne still
|
||
mov [mouse_f],3
|
||
mov [color],edx
|
||
call draw_result
|
||
jmp still ; ¢¥àãâìáï ª ç «ã 横«
|
||
;end_mouse
|
||
|
||
button:
|
||
mcall 17 ; 17 - ¯®«ãç¨âì ¨¤¥â¨ä¨ª â®à ¦ ⮩ ª®¯ª¨
|
||
cmp ah, 1 ; ¥á«¨ ¦ â ª®¯ª á ®¬¥à®¬ 1,
|
||
jz bexit ; ¢ë室¨¬
|
||
;®¡à ¡®âª ª®¯ª¨ Next
|
||
cmp ah, 12 ; ¥á«¨ ¦ â ª®¯ª NEXT
|
||
jne next_bg ; ¢ë室¨¬
|
||
inc [pnext] ; 㢥«¨ç¨¢ ¥¬ ¯à¨ ¦ ⨨ ®¬¥à ¯ «¨âàë
|
||
mov [renmode],0 ; ¢ª«îç ¥¬ æ¢¥â®¢ë¥ á奬ë
|
||
mov eax,[pnext] ; § ®á¨¬ § 票¥ ¢ ¥ å
|
||
cmp al,6 ; áà ¢¨¢ ¥¬ á § ¥ë¬ ª®«¨ç¥á⢮¬ ¯ «¨âà
|
||
jne next_redraw ; ¥á«¨ ¥ ¡®«ìè¥ ¬ ªá¨¬ã¬ â® ¢ë§®¢ ®âà¨á®¢ª¨
|
||
xor eax,eax ; ¨ ç¥ § ã«ï¥¬ ¯ «¨âàã default
|
||
mov [pnext],eax ; ¨ § ¯®¬¨ ¥¬ çâ® á¡à®á¨«¨ ¯ «¨âàã default
|
||
next_redraw:
|
||
call draw_palitra ; <20>ˆ‘“…Œ <20>€‹ˆ’<CB86>“
|
||
jmp still ; “室¨¬ ®¦¨¤ ¨¥ ¤à㣮£® ᮡëâ¨ï
|
||
next_bg:
|
||
cmp ah, 14 ; Š®¯ª BACKGROUND
|
||
jne next_bg2 ; ¥á«¨ ¥ ¦ â â® ¢ë室¨¬
|
||
call set_background ; ¨ ç¥ ãáâ ¢«¨¢ ¥¬ ä®
|
||
jmp still ; ¨ ®¦¨¤ ¨¥ ᮡëâ¨ï
|
||
next_bg2:
|
||
cmp ah, 16 ; Š®¯ª BACKGROUND
|
||
jne circle_bg ; ¥á«¨ ¥ ¦ â â® ¢ë室¨¬
|
||
call set_background2 ; ¨ ç¥ ãáâ ¢«¨¢ ¥¬ ä®
|
||
jmp still ; ¨ ®¦¨¤ ¨¥ ᮡëâ¨ï
|
||
circle_bg:
|
||
cmp ah, 15 ; Š®¯ª Šà㣮¢ ï ¯ «¨âà
|
||
jne next_end ; ¥á«¨ ¥ ¦ â â® ¢ë室¨¬
|
||
mov [renmode],2 ; ¢ª«îç ¥¬ ®âà¨á®¢ªã ªà㣮¢®© ¯ «¨âàë
|
||
call draw_palitra ; <20>ˆ‘“…Œ <20>€‹ˆ’<CB86>“
|
||
jmp still ; ¨ ®¦¨¤ ¨¥ ᮡëâ¨ï
|
||
next_end:
|
||
cmp ah,13 ; COLOR SWAP
|
||
jne color_swap_end
|
||
push [color2]
|
||
push [color]
|
||
pop [color2]
|
||
pop [color]
|
||
call draw_result
|
||
jmp still ; ˆ ã室¨¬ ®¦¨¤ ¨¥ ¤à㣮£® ᮡëâ¨ï
|
||
color_swap_end:
|
||
cmp ah, 7 ; <20>஢¥à塞 ¦ â ª®¯ª á ID=7
|
||
jne color_button ; …᫨ ¥ ¦ â , â® ¨¤ñ¬ ¤ «ìè¥
|
||
call mouse_get ; ˆ ç¥ ¢ª«îç ¥¬ ®¡à ¡®â稪 ¬ëè¨, ç⮡ë áç¨â âì § 票¥ 梥â á ¯ «¨âàë
|
||
jmp still ; ˆ ã室¨¬ ®¦¨¤ ¨¥ ¤à㣮£® ᮡëâ¨ï
|
||
color_button: ; <20>€‘—ð’ ª®®à¤¨ â ¤«ï ¯®«§ãª®¢ RGBA
|
||
push eax ; § ¯®¬¨ ¥¬ ¥ å
|
||
call mouse_local ; ¯®«ãç ¥¬ «®ª «ìë¥ ª®®à¤¨ âë
|
||
mov ebx,137 ; ¨¦ïï £à ¨æ ¯®«§ãª ¯® “
|
||
mov ecx,[mouse_y] ; § ¨á¨¬ ¢ ¥áå § 票¥ ªãàá®à ¯® “
|
||
sub ebx,ecx ; 室¨¬ à §®áâì (â.¥. ªã¤ á¬¥é ¥âáï ¯®«§ã®ª)
|
||
mov ecx,3 ; § ®á¨¬ ¢ ¥áå æ¨äàã 3 (256/3=85, £¤¥ 85-¢ëá®â ¯®«§ãª®¢)
|
||
imul ecx,ebx ; 室¨¬ ¨áâ¨ë© ¯ à ¬¥âà 梥â á ãçñ⮬ ¬ áèâ ¡ ¯®«§ãª ---+
|
||
pop eax ; ¢®ááâ ¢«¨¢ ¥¬ ¥ å :
|
||
;red_button: ; Šà áë© ’४¡ à :
|
||
cmp ah, 8 ; ID=8 :
|
||
jne green_button ; ¥á«¨ ¥â, â® ¯à®¢¥à塞 §¥«ñë© â४¡ à :
|
||
mov [cred],cl ; ¨ ç¥ ¯à¨á¢ ¨¢ ¥¬ § 票¥, ªà ᮬã 梥âã ᯥªâà <------+
|
||
call set_spectr ; ãáâ ¢«¨¢ ¥¬ ᯥªâà
|
||
jmp still ; “室¨¬ ®¦¨¤ ¨¥ ¤à㣮£® ᮡëâ¨ï
|
||
green_button:
|
||
cmp ah, 9
|
||
jne blue_button
|
||
mov [cgreen],cl
|
||
call set_spectr
|
||
jmp still ; “室¨¬ ®¦¨¤ ¨¥ ¤à㣮£® ᮡëâ¨ï
|
||
blue_button:
|
||
cmp ah, 10
|
||
jne alpha_button
|
||
mov [cblue],cl
|
||
call set_spectr
|
||
jmp still ; “室¨¬ ®¦¨¤ ¨¥ ¤à㣮£® ᮡëâ¨ï
|
||
alpha_button:
|
||
cmp ah, 11
|
||
jne still
|
||
mov [calpha],cl
|
||
call set_spectr
|
||
jmp still ; “室¨¬ ®¦¨¤ ¨¥ ¤à㣮£® ᮡëâ¨ï
|
||
bexit:
|
||
mcall -1 ; ¨ ç¥ ª®¥æ ¯à®£à ¬¬ë
|
||
;end_button
|
||
|
||
;#___________________________________________________________________________________________________
|
||
;****************************************************************************************************|
|
||
; ƒ‹€‚<E282AC>›‰ ŒŽ„“‹œ Ž’<C5BD>ˆ‘Ž‚Šˆ ŽŠ<C5BD>€ ˆ <20>‹…Œ…<C592>’Ž‚ <20><>ˆ‹Ž†…<E280A0>ˆŸ |
|
||
;----------------------------------------------------------------------------------------------------/
|
||
draw_main:
|
||
mov eax,12 ; äãªæ¨ï 12: ®§ ç ¥â, çâ® ¡ã¤¥â à¨á®¢ âìáï ®ª®
|
||
mov ebx,1 ; 1, ç «® à¨á®¢ ¨ï
|
||
int 0x40 ; <20>à¥àë¢ ¨¥
|
||
|
||
mov eax,48 ; ”ãªæ¨ï 48 - á⨫¨ ®â®¡à ¦¥¨ï ®ª®
|
||
mov ebx,3 ; <20>®¤äãªæ¨ï 3 - ¯®«ãç¨âì áâ ¤ àâë¥ æ¢¥â ®ª®.
|
||
mov ecx,sc ; “ª § â¥«ì ¡ãä¥à à §¬¥à®¬ edx ¡ ©â, ¯®¤ áâàãªâãàã
|
||
mov edx,sizeof.system_colors ; <20> §¬¥à â ¡«¨æë 梥⮢ (¤®«¦¥ ¡ëâì 40 ¡ ©â)
|
||
int 0x40 ; <20>à¥àë¢ ¨¥
|
||
|
||
mov eax,48 ; ”ãªæ¨ï 48 - á⨫¨ ®â®¡à ¦¥¨ï ®ª®.
|
||
mov ebx,4 ; <20>®¤äãªæ¨ï 4 - ¢®§¢à é ¥â eax = ¢ëá®â ᪨ .
|
||
int 0x40 ; <20>à¥àë¢ ¨¥
|
||
mov ecx,eax ; ‡ ¯®¬¨ ¥¬ ¢ëá®âã ᪨
|
||
|
||
mov edi,[runmode]
|
||
cmp edi,2
|
||
jne no_hiddenmode
|
||
mov edi,hidden
|
||
jmp set_title
|
||
no_hiddenmode:
|
||
cmp edi,3
|
||
jne no_dialogmode
|
||
mov edi,hidden
|
||
jmp set_title
|
||
no_dialogmode:
|
||
mov edi,title ; ‡ £®«®¢®ª ®ª
|
||
set_title:
|
||
|
||
xor eax,eax ; Žç¨é ¥¬ eax (mov eax,0) (”ãªæ¨ï 0)
|
||
mov ebx,WIN_X shl 16+WIN_W ; [ª®®à¤¨ â ¯® ®á¨ x]*65536 + [à §¬¥à ¯® ®á¨ x]
|
||
add ecx,WIN_Y shl 16+WIN_H ; ‚ëá®â ᪨ + [ª®®à¤¨ â ¯® y]*65536 + [à §¬¥à ¯® y] (168 ¤«ï ¢¥àᨨ 0.2)
|
||
mov edx,[sc.work] ; ‚¨¤¨¬® áâ¨«ì ®ª ¯® ¤¥ä®«âã
|
||
or edx,0x34000000 ; ˆ«¨ ®ª® ᮠ᪨®¬ 䨪á¨à®¢ ëå à §¬¥à®¢
|
||
|
||
int 0x40 ; <20>à¥àë¢ ¨¥
|
||
|
||
|
||
call draw_palitra ; <20>ˆ‘“…Œ <20>€‹ˆ’<CB86>“
|
||
call draw_result ; <20>ˆ‘“…Œ <20>…‡“‹œ’€’
|
||
|
||
mov eax,8 ; ”ãªæ¨ï 8 - ®¯à¥¤¥«¨âì/㤠«¨âì ª®¯ªã
|
||
mov ebx,110 shl 16+147 ; <20> ç «ìë¥ ª®®à¤¨ âë ¯® å [ª-â x]*65536 + [à §¬¥à]
|
||
mov ecx,9 shl 16+147 ; <20> ç «ìë¥ ª®®à¤¨ âë ¯® y [ª-â y]*65536 + [à §¬¥à]
|
||
mov edx,0x60000007 ; <20> ç «ì®¥ ID ª®¯®ª - 0xXYnnnnnn
|
||
int 0x40
|
||
|
||
mov ebx,13 shl 16+12 ; <20> ç «ìë¥ ª®®à¤¨ âë ¯® å [ª-â x]*65536 + [à §¬¥à]
|
||
mov edx,0x60000008 ; ID = 8
|
||
mov ecx,51 shl 16+85 ; <20> ç «ìë¥ ª®®à¤¨ âë ¯® y [ª-â y]*65536 + [à §¬¥à]
|
||
int 0x40 ; <20>¨á㥬 ¥¢¨¤¨¬ãî ª®¯ªã ¯®¤ á« ©¤¥à®¬ red
|
||
add ebx,23 shl 16 ; „®¡ ¢«ï¥¬
|
||
inc edx ; ID = 9
|
||
int 0x40 ; <20>¨á㥬 ¥¢¨¤¨¬ãî ª®¯ªã ¯®¤ á« ©¤¥à®¬ green
|
||
add ebx,23 shl 16 ; „®¡ ¢«ï¥¬
|
||
inc edx ; ID = 10
|
||
int 0x40 ; <20>¨á㥬 ¥¢¨¤¨¬ãî ª®¯ªã ¯®¤ á« ©¤¥à®¬ blue
|
||
add ebx,23 shl 16 ; „®¡ ¢«ï¥¬
|
||
inc edx ; ID = 11
|
||
int 0x40 ; <20>¨á㥬 ¥¢¨¤¨¬ãî ª®¯ªã ¯®¤ á« ©¤¥à®¬ alpha
|
||
|
||
mov eax,8 ; ”ãªæ¨ï 8 - ®¯à¥¤¥«¨âì/㤠«¨âì ª®¯ªã (‘Œ…<C592>€ –‚…’€)
|
||
mov ebx,11 shl 16+20 ; <20> ç «ìë¥ ª®®à¤¨ âë ¯® å [ª-â x]*65536 + [à §¬¥à]
|
||
mov ecx,12 shl 16+20 ; <20> ç «ìë¥ ª®®à¤¨ âë ¯® y [ª-â y]*65536 + [à §¬¥à]
|
||
mov edx,0x6000000D ; ID = 13
|
||
int 0x40
|
||
|
||
call draw_bottom_panel
|
||
call draw_left_panel
|
||
|
||
mov eax,12 ; äãªæ¨ï 12: ®§ ç ¥â, çâ® ¡ã¤¥â à¨á®¢ âìáï ®ª®
|
||
mov ebx,2 ; 2 - ª®¥æ à¨á®¢ ¨ï
|
||
int 0x40 ; <20>à¥àë¢ ¨¥
|
||
ret
|
||
|
||
;#___________________________________________________________________________________________________
|
||
;****************************************************************************************************|
|
||
; <20>‹ŽŠ ‚‘<E2809A>ŽŒŽƒ€’…‹œ<E280B9>›• <20><>Ž–…„“<E2809E> ˆ ”“<E2809D>Š–ˆ‰ <20><>ˆ‹Ž†…<E280A0>ˆŸ |
|
||
;----------------------------------------------------------------------------------------------------/
|
||
|
||
|
||
;------------------------------------------------------------------------------------------------+
|
||
draw_left_panel: ; Žâà¨á®¢ª ¡®ª®¢®© ¯ ¥«¨
|
||
;.................................................................................................
|
||
mov eax,8 ; button_next_colorsheme
|
||
mov ebx,266 shl 16+16 ; [x] + [size]
|
||
mov ecx,9 shl 16+16 ; [y] + [size]
|
||
mov edx,0x6000000C ; ID = 12
|
||
mov esi,[sc.work_button] ; RGB
|
||
int 0x40 ; call
|
||
; circle diagram
|
||
add ecx,19 shl 16 ; move rect
|
||
mov edx,0x6000000F ; ID = 15
|
||
int 0x40 ; call
|
||
|
||
mov eax,7 ; 7 - ®¬¥à äãªæ¨¨
|
||
mov ebx,panel ; 㪠§ â¥«ì ¨§®¡à ¦¥¨¥ ¢ ä®à¬ ⥠BBGGRRBBGGRR...
|
||
mov ecx, 16 shl 16 + 149 ; [à §¬¥à ¯® ®á¨ x]*65536 + [à §¬¥à ¯® ®á¨ y]
|
||
mov edx,266 shl 16 + 9 ; [ª®®à¤¨ â ¯® ®á¨ x]*65536 + [ª®®à¤¨ â ¯® ®á¨ y]
|
||
int 0x40
|
||
|
||
;mov eax,13 ; draw rect
|
||
;mov ebx,266 shl 16+16 ; [x] + [size]
|
||
;mov ecx,9 shl 16+16 ; [y] + [size]
|
||
;mov edx,0x666666 ; RGB
|
||
;push esi ; backup esi
|
||
;mov esi,8 ; counter=8
|
||
;draw_lpanel: ; loop label
|
||
; int 0x40 ; call draw black rect
|
||
; add ecx,19 shl 16 ; move rect
|
||
; dec esi ; decrement counter
|
||
; cmp esi,0 ; if counter!=zero
|
||
; jne draw_lpanel ; then goto label
|
||
; mov esi,8 ; else counter=8
|
||
; mov ebx,267 shl 16+14 ; [x] + [size]
|
||
; mov ecx,10 shl 16+14 ; [y] + [size]
|
||
; mov edx,0xF3F3F3 ; RGB
|
||
;draw_lpanel2: ; 2 loop label
|
||
; int 0x40 ; call draw white rect
|
||
; add ecx,19 shl 16 ; move rect
|
||
; dec esi ; decrement counter
|
||
; cmp esi,0 ; if counter!=0
|
||
; jne draw_lpanel2 ; then goto label2
|
||
;pop esi ; restore esi
|
||
; draw_left_arrow for button_next_colorsheme
|
||
;mov eax,4 ; Write string
|
||
;mov ebx,272 shl 16+13 ; [x] + [y]
|
||
;mov ecx,0x0 ; RGB
|
||
;mov edx,larrow ; string pointer
|
||
;mov esi,1 ; count symbol
|
||
;int 0x40 ; call
|
||
;mov eax,38 ; draw line
|
||
;mov ebx,270 shl 16+272 ; [start x] + [end x]
|
||
;mov ecx,16 shl 16+16 ; [start y] + [end y]
|
||
;mov edx,0x0 ; RGB
|
||
;int 0x40 ; call
|
||
ret ; return
|
||
;.................................................................................................
|
||
|
||
|
||
;------------------------------------------------------------------------------------------------+
|
||
draw_bottom_panel: ; Žâà¨á®¢ª ¨¦¥© ¯ ¥«¨
|
||
;.................................................................................................
|
||
mov eax,8 ; draw button
|
||
mov ebx,(92) shl 16+90 ; [x] + [size]
|
||
mov ecx,169 shl 16+16 ; [y] + [size]
|
||
mov edx,14 ; ID = 14
|
||
mov esi,[sc.work_button] ; RGB
|
||
int 0x40 ; call
|
||
|
||
add ebx, 100 shl 16
|
||
add edx, 2
|
||
int 0x40
|
||
|
||
mov eax,4 ; Write string
|
||
mov ebx,(113 - 104) shl 16+174 ; [x] + [y]
|
||
mov ecx,[sc.work_text] ; RGB
|
||
or ecx, 1 shl 31
|
||
mov edx,bground ; string pointer
|
||
int 0x40 ; call
|
||
|
||
mov ecx, [sc.work_button_text]
|
||
or ecx, 1 shl 31
|
||
|
||
add ebx, 106 shl 16
|
||
mov edx, bground1
|
||
int 0x40
|
||
|
||
add ebx, 107 shl 16
|
||
mov edx, bground2
|
||
int 0x40
|
||
|
||
mov eax,38 ; draw line
|
||
mov ebx,4 shl 16+282 ; [start x] + [end x]
|
||
mov ecx,163 shl 16+163 ; [start y] + [end y]
|
||
mov edx,0x00666666 ; RGB
|
||
int 0x40 ; call
|
||
ret ; return
|
||
;.................................................................................................
|
||
|
||
mouse_global:
|
||
;.................................................................................................
|
||
; <20>®«ãç ¥¬ ª®®à¤¨ âë ¬ëè¨
|
||
;.................................................................................................
|
||
mov eax,37 ; ”ãªæ¨ï 37 - à ¡®â á ¬ëèìî
|
||
mov ebx,0 ; ¬ ã¦ë £«®¡ «ìë¥ ª®®à¤¨ âë
|
||
int 0x40 ; eax = x*65536 + y, (x,y)=ª®®à¤¨ âë ªãàá®à ¬ëè¨
|
||
mov ecx,eax ;
|
||
shr ecx,16 ; ecx = x+1
|
||
movzx edx,ax ; edx = y+1
|
||
dec ecx ; ecx = x
|
||
dec edx ; edx = y
|
||
mov [mouse_x],ecx ; mouse_x = x
|
||
mov [mouse_y],edx ; mouse_y = y
|
||
ret ; ‚®§¢à é ¥¬ ã¯à ¢«¥¨¥
|
||
;end_mouse_global
|
||
|
||
mouse_local:
|
||
;.................................................................................................
|
||
; <20>®«ãç ¥¬ ª®®à¤¨ âë ¬ëè¨ ®â®á¨â¥«ì® ®ª
|
||
;.................................................................................................
|
||
mov eax,37 ; ”ãªæ¨ï 37 - à ¡®â á ¬ëèìî
|
||
mov ebx,1 ; ¬ ã¦ë £«®¡ «ìë¥ ª®®à¤¨ âë
|
||
int 0x40 ; eax = x*65536 + y, (x,y)=ª®®à¤¨ âë ªãàá®à ¬ëè¨
|
||
mov ecx,eax ;
|
||
shr ecx,16 ; ecx = x+1
|
||
movzx edx,ax ; edx = y+1
|
||
dec ecx ; ecx = x
|
||
dec edx ; edx = y
|
||
mov [mouse_x],ecx ; mouse_x = x
|
||
mov [mouse_y],edx ; mouse_y = y
|
||
ret ; ‚®§¢à é ¥¬ ã¯à ¢«¥¨¥
|
||
;end_mouse_local
|
||
|
||
set_background:
|
||
;.................................................................................................
|
||
; “áâ ¢«¨¢ ¥â ä® à ¡®ç¥£® á⮫
|
||
;.................................................................................................
|
||
mov eax,15 ; ”ãªæ¨ï 15 - à ¡®â á ä®®¢®© £à 䨪®©
|
||
mov ebx,4 ; <20>®¤äãªæ¨ï 4 - ãáâ ®¢¨âì ०¨¬ ®âà¨á®¢ª¨ ä® .
|
||
mov ecx,2 ; <20>¥¦¨¬ ®âà¨á®¢ª¨ - § ¬®áâ¨âì (1)
|
||
int 0x40 ; ‚ë§ë¢ ¥¬
|
||
|
||
mov eax,15 ; ”ãªæ¨ï 15 - à ¡®â á ä®®¢®© £à 䨪®©
|
||
mov ebx,1 ; <20>®¤äãªæ¨ï 1 - ãáâ ®¢¨âì à §¬¥à ä®®¢®£® ¨§®¡à ¦¥¨ï.
|
||
mov ecx,2 ; ˜¨à¨ ¨§®¡à ¦¥¨ï
|
||
mov edx,2 ; ‚ëá®â ¨§®¡à ¦¥¨ï
|
||
int 0x40 ; ‚ë§ë¢ ¥¬
|
||
|
||
mov eax,[color]
|
||
mov [cm+0],al
|
||
mov [cm+9],al
|
||
shr eax,8
|
||
mov [cm+1],al
|
||
mov [cm+10],al
|
||
shr eax,8
|
||
mov [cm+2],al
|
||
mov [cm+11],al
|
||
|
||
mov eax,[color2]
|
||
mov [cm+3],al
|
||
mov [cm+6],al
|
||
shr eax,8
|
||
mov [cm+4],al
|
||
mov [cm+7],al
|
||
shr eax,8
|
||
mov [cm+5],al
|
||
mov [cm+8],al
|
||
|
||
mov eax,15 ; ”ãªæ¨ï 15 - à ¡®â á ä®®¢®© £à 䨪®©
|
||
mov ebx,5 ; <20>®¤äãªæ¨ï 5 - ¯®¬¥áâ¨âì ¡«®ª ¯¨ªá¥«¥© ä®.
|
||
mov ecx,cm ; “ª § â¥«ì ¤ ë¥ ¢ ä®à¬ ⥠BBGGRRBBGGRR
|
||
mov edx,0 ; C¬¥é¥¨¥ ¢ ¤ ëå ä®®¢®£® ¨§®¡à ¦¥¨ï
|
||
mov esi,3*4 ; <20> §¬¥à ¤ ëå ¢ ¡ ©â å = 3 * ç¨á«® ¯¨ªá¥«¥©
|
||
int 0x40 ; ‚ë§ë¢ ¥¬
|
||
|
||
mov eax,15 ; ”ãªæ¨ï 15 - à ¡®â á ä®®¢®© £à 䨪®©
|
||
mov ebx,3 ; <20>®¤äãªæ¨ï 3 - ¯¥à¥à¨á®¢ âì ä®.
|
||
int 0x40 ; ‚ë§ë¢ ¥¬
|
||
|
||
ret
|
||
;end_set_background
|
||
|
||
desktop_get:
|
||
;.................................................................................................
|
||
; Ž¯à¥¤¥«ï¥¬ è¨à¨ã íªà
|
||
;.................................................................................................
|
||
mov eax,14 ; Ž¯à¥¤¥«ï¥¬ è¨à¨ã íªà (eax = [xsize]*65536 + [ysize])
|
||
int 0x40 ; xsize = à §¬¥à ¯® £®à¨§®â «¨ - 1
|
||
mov ebx,eax ;
|
||
shr ebx,16 ; ebx = xsize-1
|
||
movzx edx,ax ; edx = ysize-1 («¨è¨© ª®¤)
|
||
inc ebx ; ebx = xsize
|
||
inc edx ; edx = ysize («¨è¨© ª®¤)
|
||
mov [desctop_w],ebx
|
||
mov [desctop_h],edx
|
||
ret
|
||
;end_desktop_get
|
||
|
||
mouse_get:
|
||
mov esi,2 ; ŠŽ‘’›‹œ: ä« £ ¤«ï ¨§¡¥¦ ¨ï § 横«¨¢ ¨ï
|
||
call mouse_global
|
||
call desktop_get
|
||
re_mouse_loop: ; ŠŽ‘’›‹œ: ¬¥âª ¤«ï ¢®§¢à ⠥᫨ ¯®¯ «¨ ¢ á¥âªã
|
||
mov ebx,[desctop_w]
|
||
imul ebx,[mouse_y] ; ebx = y*xsize
|
||
add ebx,[mouse_x] ; ebx = y*xsize+x
|
||
|
||
;.................................................................................................
|
||
; <20>¥à¥¬ 梥â á ¯ «¨âàë ¢ ¯¥à¥¬¥ãî
|
||
;.................................................................................................
|
||
mov eax,35 ; ”ãªæ¨ï ¢§ïâ¨ï 梥â
|
||
;mov ebx,ecx ;; ebx = y*xsize+x («¨è¨© ª®¤)
|
||
int 0x40 ; <20>®«ãç ¥¬ 梥⠢ eax
|
||
cmp eax,[sc.work] ; ‘à ¢¨¢ ¥¬ á ä®®¬ ¯à¨«®¦¥¨ï
|
||
je mouse_err ; …᫨ íâ® ® - â® ¨ç¥£® ¥ ¤¥« ¥¬
|
||
cmp eax,0x222222 ; ‘à ¢¨¢ ¥¬ á 梥⮬ á¥âª¨
|
||
je mouse_err ; …᫨ íâ® ® - â® ¨ç¥£® ¥ ¤¥« ¥¬
|
||
jmp mouse_set ; ŠŽ‘’›‹œ: ¯àë£ ¥¬ çâ®¡ë ¥ ¡à âì 梥â á¥âª¨
|
||
mouse_err: ; ŠŽ‘’›‹œ: ¥á«¨ ¯®¯ «¨ ¢ á¥âªã ¨«¨ ä®
|
||
inc [mouse_y] ; ŠŽ‘’›‹œ: á¬¥é ¥¬ ¯® ¤¨ £® «¨ á ç « ¯® å
|
||
inc [mouse_x] ; ŠŽ‘’›‹œ: á¬¥é ¥¬ ¯® ¤¨ £® «¨ ¯®â®¬ ¯® ã
|
||
dec esi ; ŠŽ‘’›‹œ: “¬¥ìè ¥¬ ä« £
|
||
cmp esi,0 ; ŠŽ‘’›‹œ: ‘à ¢¨¢ ¥¬ á ã«¥¬
|
||
jz mouse_exit ; ŠŽ‘’›‹œ: …᫨ ®«ì ⮠ᤥ« «¨ ¢áñ çâ® ¬®£«¨
|
||
jmp re_mouse_loop ; ŠŽ‘’›‹œ: …᫨ ¥ ®«ì â® ¯®¯à®¡ã¥¬ ¢§ïâì á®á¥«¨© ¯¨ªá¥«ì
|
||
mouse_set: ; ˆ ç¥ § ¯®¬¨ ¥¬ ®¢ë© 梥â
|
||
cmp [mouse_f],1
|
||
jne was_right
|
||
mov [color],eax
|
||
call draw_result
|
||
jmp mouse_exit
|
||
was_right:
|
||
cmp [mouse_f],2
|
||
jne mouse_exit
|
||
mov [color2],eax
|
||
call draw_result ; ‚뢮¤¨¬ १ã«ìâ â
|
||
mouse_exit:
|
||
ret ; ‚®§¢à é ¥¬ ã¯à ¢«¥¨¥
|
||
;end_mouse_get----------------------------------------------------------------------------------------
|
||
|
||
draw_palitra:
|
||
mov eax,13 ; ”ãªæ¨ï 13 - à¨á®¢ âì ¯àאַ㣮«ì¨ª
|
||
mov ebx,110 shl 16+148 ; <20> ç «ìë¥ ª®®à¤¨ âë ¯® x [ª-â x]*65536 + [à §¬¥à]
|
||
mov ecx,9 shl 16+148 ; <20> ç «ìë¥ ª®®à¤¨ âë ¯® y [ª-â y]*65536 + [à §¬¥à]
|
||
mov edx,[sc.work] ; 梥â
|
||
int 0x40
|
||
|
||
cmp [renmode],2
|
||
je cyrcle_draw
|
||
;cmp [renmode],1
|
||
;je picker_draw
|
||
cmp [renmode],0
|
||
je sheme_draw
|
||
ret
|
||
|
||
;.................................................................................................
|
||
; Žâà¨á®¢ª ªà㣮¢®© ¤¨ £à ¬¬ë
|
||
;.................................................................................................
|
||
cyrcle_draw:
|
||
;mov eax,13
|
||
;mov edx,0x666666
|
||
;mov ebx,108*65536+152
|
||
;mov ecx,125*65536+33
|
||
;mcall
|
||
;mov edx,0xF3F3F3
|
||
;mov ebx,109*65536+150
|
||
;mov ecx,126*65536+31
|
||
;mcall
|
||
|
||
;mov eax,4 ; 4 - ¢ë¢¥á⨠áâபã ⥪áâ ¢ ®ª®
|
||
;mov ebx,115 shl 16+131 ; [ª®®à¤¨ â ¯® ®á¨ x]*65536 + [ª®®à¤¨ â ¯® ®á¨ y]
|
||
;mov ecx,0x666666 ; 0xX0RRGGBB (RR, GG, BB § ¤ îâ 梥â ⥪áâ )
|
||
;mov edx,hint ; 㪠§ ⥫ì ç «® áâப¨
|
||
;mov esi,24 ; ¢ë¢®¤¨âì esi ᨬ¢®«®¢
|
||
;mcall
|
||
;mov ebx,125 shl 16+144 ; [ª®®à¤¨ â ¯® ®á¨ x]*65536 + [ª®®à¤¨ â ¯® ®á¨ y]
|
||
;mov edx,hint2 ; 㪠§ ⥫ì ç «® áâப¨
|
||
;mov esi,21 ; ¢ë¢®¤¨âì esi ᨬ¢®«®¢
|
||
;mcall
|
||
|
||
;mov edx,[color]
|
||
;mov ebx,109*65536+150
|
||
;mov ecx, 10*65536+150
|
||
;mcall
|
||
call mouse_local ; ¯®«ãç ¥¬ ª®®à¤¨ âë ¬ëè¨ ®â®á¨â¥«ì® ®ª
|
||
mov ecx, [mouse_x] ; § ®á¨¬ ¢ ॣ¨áâà
|
||
mov edx, [mouse_y] ; § ®á¨¬ ¢ ॣ¨áâà
|
||
cmp ecx, WIN_W-10
|
||
jg cyrcle_draw_2
|
||
cmp edx, WIN_H
|
||
jle end_cyrcle_draw
|
||
|
||
cyrcle_draw_2:
|
||
mcall 5,10
|
||
call desktop_get
|
||
call mouse_global
|
||
|
||
mov ebx,112*65536+11
|
||
mov esi,0 ; counter=8
|
||
circle_loop:
|
||
mov ecx, 10*65536+11
|
||
mov edi,0
|
||
circle_loop2:
|
||
mov eax,13
|
||
call circle_pixel_read
|
||
mcall
|
||
add ecx,11 shl 16
|
||
inc edi
|
||
cmp edi,13
|
||
jne circle_loop2
|
||
|
||
add ebx,11 shl 16
|
||
inc esi
|
||
cmp esi,13
|
||
jne circle_loop
|
||
|
||
|
||
mov eax,13
|
||
mov edx,0x0
|
||
mov ebx,177*65536+13
|
||
mov ecx, 76*65536+13
|
||
mcall
|
||
mov ecx, [mouse_x]
|
||
mov edx, [mouse_y]
|
||
inc ecx
|
||
inc edx
|
||
mov ebx, edx
|
||
imul ebx, [desctop_w]
|
||
add ebx, ecx
|
||
mov eax, 35
|
||
mcall
|
||
mov edx,eax
|
||
mov eax,13
|
||
mov ebx,178*65536+11
|
||
mov ecx, 77*65536+11
|
||
mcall
|
||
ret
|
||
end_cyrcle_draw:
|
||
mov eax,13
|
||
mov edx,0x666666
|
||
mov ebx,111*65536+145
|
||
mov ecx, 9*65536+145
|
||
mcall
|
||
ret
|
||
|
||
circle_pixel_read:
|
||
push ecx
|
||
push ebx
|
||
push eax
|
||
mov ecx, [mouse_x]
|
||
mov edx, [mouse_y]
|
||
inc ecx
|
||
add ecx, esi
|
||
cmp ecx, 6
|
||
jl _cpr_exit
|
||
sub ecx, 6
|
||
inc edx
|
||
add edx, edi
|
||
cmp edx, 6
|
||
jl _cpr_exit
|
||
sub edx, 6
|
||
|
||
mov ebx, edx
|
||
imul ebx, [desctop_w]
|
||
add ebx, ecx
|
||
mov eax, 35
|
||
mcall
|
||
mov edx,eax
|
||
pop eax
|
||
pop ebx
|
||
pop ecx
|
||
ret
|
||
|
||
_cpr_exit:
|
||
mov edx,0x00000000
|
||
pop eax
|
||
pop ebx
|
||
pop ecx
|
||
ret
|
||
|
||
;picker_draw:
|
||
;ret
|
||
|
||
;.................................................................................................
|
||
; Žâà¨á®¢ª ä® ¯®¤ ª®¯ª¨
|
||
;.................................................................................................
|
||
sheme_draw:
|
||
mov eax,13 ; ”ãªæ¨ï 13 - à¨á®¢ âì ¯àאַ㣮«ì¨ª
|
||
mov edx,0x222222 ; 梥â
|
||
mov ecx,9 shl 16+73 ; <20> ç «ìë¥ ª®®à¤¨ âë ¯® y [ª-â y]*65536 + [à §¬¥à]
|
||
mov esi,2 ; ‘ç¥â稪 «¨¨© ¯®¤«®¦¥ª
|
||
re_draw:
|
||
mov ebx,110 shl 16+73 ; <20> ç «ìë¥ ª®®à¤¨ âë ¯® x [ª-â x]*65536 + [à §¬¥à]
|
||
mov edi,2 ; ‘ç¥â稪 ª®«¨ç¥á⢠¯®¤«®¦¥ª
|
||
for_fon_loop:
|
||
int 0x40 ; <20>à¥àë¢ ¨¥
|
||
add ebx,75 shl 16 ; ‘¬¥é ¥¬ ¯®«®¦¥¨¥ «¨¨¨ ¯® å
|
||
dec edi ; “¬¥ìè ¥¬ áç¥â稪 ª®¯®ª
|
||
cmp edi,0 ; ‘à ¢¨¢ ¥¬ á ã«¥¬
|
||
jnz for_fon_loop ; …᫨ ¥ ®«ì â® ¢ ç «® 横«
|
||
dec esi ; “¬¥ìè ¥¬ ¥£®
|
||
cmp esi,0 ; ‘à ¢¨¢ ¥¬ á ã«¥¬
|
||
mov ecx,84 shl 16+73 ; <20> ç «ìë¥ ª®®à¤¨ âë ¯® y [ª-â y]*65536 + [à §¬¥à]
|
||
jnz re_draw ; …᫨ ¥ ®«ì â® ¢ ç «® 横«
|
||
|
||
;.................................................................................................
|
||
; Žâà¨á®¢ª ª®¯®ª ¯® 横«ã
|
||
;.................................................................................................
|
||
mov eax,13 ; ”ãªæ¨ï 13 - à¨á®¢ âì ¯àאַ㣮«ì¨ª
|
||
mov edx,0x0FFFFFFF ; 梥â
|
||
mov esi,4 ; ‘ç¥â稪 ª®«¨ç¥á⢠¡§ 楢 (#4,8)
|
||
mov ebx,99 shl 16+8 ; <20> ç «ìë¥ ª®®à¤¨ âë ¯® x [ª-â x]*65536 + [à §¬¥à]
|
||
for_abz:
|
||
;;push esi ; ‘®åà 塞 § 票¥ áç¥â稪 «¨¨© ¢ á⥪
|
||
cmp esi,2
|
||
jne x2_line
|
||
mov ebx,99 shl 16+8
|
||
x2_line:
|
||
add ebx,3 shl 16 ; ‘¬¥é ¥¬ ¯®«®¦¥¨¥ «¨¨¨ ¯® x
|
||
mov edi,8 ; ‘ç¥â稪 ª®«¨ç¥á⢠ª®¯®ª ¢ áâப¥
|
||
for_stolbik:
|
||
push edi ; ‘®åà 塞 § 票¥ áç¥â稪 «¨¨© ¢ á⥪
|
||
mov edi,8 ; ‘ç¥â稪 ª®«¨ç¥á⢠ª®¯®ª ¢ áâப¥
|
||
mov ecx, 1 shl 16+8 ; <20> ç «ìë¥ ª®®à¤¨ âë ¯® y [ª-â y]*65536 + [à §¬¥à]
|
||
cmp esi,2
|
||
jg y2_line ; …᫨ ¡®«ìè¥ 4 â® ¨£®à¨¬
|
||
mov ecx,76 shl 16+8
|
||
y2_line:
|
||
add ebx,9 shl 16 ; ‘¬¥é ¥¬ ¯®«®¦¥¨¥ «¨¨¨ ¯® x
|
||
for_loop:
|
||
add ecx,9 shl 16 ; ‘¬¥é ¥¬ ¯®«®¦¥¨¥ «¨¨¨ ¯® y
|
||
int 0x40 ; <20>à¥àë¢ ¨¥
|
||
call sub_red
|
||
dec edi ; “¬¥ìè ¥¬ áç¥â稪 ª®¯®ª
|
||
cmp edi,0 ; ‘à ¢¨¢ ¥¬ á ã«¥¬
|
||
jnz for_loop ; …᫨ ¥ ®«ì â® ¢ ç «® 横«
|
||
call sub_green
|
||
pop edi ; ˆ ç¥ ¢®ááâ ¢«¨¢ ¥¬ áç¥â稪 «¨¨©
|
||
dec edi ; “¬¥ìè ¥¬ ¥£®
|
||
cmp edi,0 ; ‘à ¢¨¢ ¥¬ á ã«¥¬
|
||
jnz for_stolbik ; …᫨ ¥ ®«ì â® ¢ ç «® 横«
|
||
call sub_blue
|
||
;;pop esi ; ˆ ç¥ ¢®ááâ ¢«¨¢ ¥¬ áç¥â稪 «¨¨©
|
||
dec esi ; “¬¥ìè ¥¬ ¥£®
|
||
cmp esi,0 ; ‘à ¢¨¢ ¥¬ á ã«¥¬
|
||
jnz for_abz ; …᫨ ¥ ®«ì â® ¢ ç «® 横«
|
||
ret ; ‚®§¢à é ¥¬ ã¯à ¢«¥¨¥
|
||
;end_draw_palitra-------------------------------------------------------------------------------------
|
||
|
||
|
||
sub_red:
|
||
;.................................................................................................
|
||
; <20> áçñâ ᬥ饨© ªà ᮣ® 梥⠢ £¥¥à 樨 梥⠯ «¨âàë
|
||
;.................................................................................................
|
||
push eax
|
||
mov eax,[pnext]
|
||
;sub_red_0 ; palitra
|
||
cmp al,0
|
||
jne sub_red_1
|
||
sub edx,0x40
|
||
jmp sub_red_e
|
||
sub_red_1: ; random
|
||
cmp al,1
|
||
jne sub_red_2
|
||
sub edx,0x20
|
||
jmp sub_red_e
|
||
sub_red_2: ; gree
|
||
cmp al,2
|
||
jne sub_red_3
|
||
sub edx,0x010101
|
||
jmp sub_red_e
|
||
sub_red_3: ; red
|
||
cmp al,3
|
||
jne sub_red_4
|
||
sub edx,0x0101
|
||
jmp sub_red_e
|
||
sub_red_4: ; green
|
||
cmp al,4
|
||
jne sub_red_5
|
||
sub edx,0x010001
|
||
jmp sub_red_e
|
||
sub_red_5: ; blue
|
||
cmp al,5
|
||
jne sub_red_e
|
||
sub edx,0x010100
|
||
jmp sub_red_e
|
||
sub_red_e:
|
||
pop eax
|
||
ret ; ‚®§¢à é ¥¬ ã¯à ¢«¥¨¥
|
||
;end_sub_red------------------------------------------------------------------------------------------
|
||
|
||
sub_green:
|
||
;.................................................................................................
|
||
; <20> áçñâ ᬥ饨© ªà ᮣ® 梥⠢ £¥¥à 樨 梥⠯ «¨âàë
|
||
;.................................................................................................
|
||
push eax
|
||
mov eax,[pnext]
|
||
;sub_green_0
|
||
cmp al,0
|
||
jne sub_green_1
|
||
sub edx,0x4000
|
||
jmp sub_green_e
|
||
sub_green_1:
|
||
cmp al,1
|
||
jne sub_green_e
|
||
sub edx,0x2000
|
||
;jmp sub_green_e
|
||
sub_green_e:
|
||
pop eax
|
||
ret ; ‚®§¢à é ¥¬ ã¯à ¢«¥¨¥
|
||
;end_sub_green----------------------------------------------------------------------------------------
|
||
|
||
|
||
sub_blue:
|
||
;.................................................................................................
|
||
; <20> áçñâ ᬥ饨© ªà ᮣ® 梥⠢ £¥¥à 樨 梥⠯ «¨âàë
|
||
;.................................................................................................
|
||
push eax
|
||
mov eax,[pnext]
|
||
;sub_blue_0
|
||
cmp al,0
|
||
jne sub_blue_1
|
||
sub edx,0x600000
|
||
jmp sub_blue_e
|
||
sub_blue_1:
|
||
cmp al,1
|
||
jne sub_blue_e
|
||
sub edx,0x400000
|
||
;jmp sub_blue_e
|
||
sub_blue_e:
|
||
pop eax
|
||
ret ; ‚®§¢à é ¥¬ ã¯à ¢«¥¨¥
|
||
;end_sub_blue-----------------------------------------------------------------------------------------
|
||
|
||
draw_result:
|
||
;.................................................................................................
|
||
; <20>®«ìè ï à ¬ª ¢ë¢®¤ १ã«ìâ â
|
||
;.................................................................................................
|
||
mov eax,13 ; ”ãªæ¨ï 13 - à¨á®¢ âì ¯àאַ㣮«ì¨ª
|
||
mov edx,0x00666666 ; 梥â-®¡¢®¤ª¨
|
||
mov ebx,4 shl 16+98 ; <20> ç «ìë¥ ª®®à¤¨ âë ¯® x [ª-â x]*65536 + [à §¬¥à]
|
||
mov ecx,9 shl 16+148 ; <20> ç «ìë¥ ª®®à¤¨ âë ¯® y [ª-â y]*65536 + [à §¬¥à]
|
||
int 0x40
|
||
mov edx,0x00F3F3F3 ; 梥â-ä®
|
||
mov ebx,5 shl 16+96 ; <20> ç «ìë¥ ª®®à¤¨ âë ¯® x [ª-â x]*65536 + [à §¬¥à]
|
||
mov ecx,10 shl 16+146 ; <20> ç «ìë¥ ª®®à¤¨ âë ¯® y [ª-â y]*65536 + [à §¬¥à]
|
||
int 0x40
|
||
|
||
;.................................................................................................
|
||
; Žâà¨á®¢ª १ã«ìâ â 梥⠢ hex color2
|
||
;.................................................................................................
|
||
mov eax,13 ; ”ãªæ¨ï 13 - à¨á®¢ âì ¯àאַ㣮«ì¨ª
|
||
; color 2 - draw fringle
|
||
mov edx,0x222222 ; 梥â-®¡¢®¤ª¨
|
||
mov ebx,16 shl 16+15 ; <20> ç «ìë¥ ª®®à¤¨ âë ¯® x [ª-â x]*65536 + [à §¬¥à]
|
||
mov ecx,16 shl 16+15 ; <20> ç «ìë¥ ª®®à¤¨ âë ¯® y [ª-â y]*65536 + [à §¬¥à]
|
||
int 0x40 ; <20>à¥àë¢ ¨¥ (®á à¨áã¥â ¯àאַ㣮«ì¨ª)
|
||
; color 2 - draw color
|
||
mov edx,[color2] ; 梥â
|
||
mov ebx,17 shl 16+13 ; <20> ç «ìë¥ ª®®à¤¨ âë ¯® x [ª-â x]*65536 + [à §¬¥à]
|
||
mov ecx,17 shl 16+13 ; <20> ç «ìë¥ ª®®à¤¨ âë ¯® y [ª-â y]*65536 + [à §¬¥à]
|
||
int 0x40 ; <20>à¥àë¢ ¨¥ (®á à¨áã¥â ¯àאַ㣮«ì¨ª)
|
||
; color 1 - draw fringle
|
||
mov edx,0x222222 ; 梥â-®¡¢®¤ª¨
|
||
mov ebx,11 shl 16+15 ; <20> ç «ìë¥ ª®®à¤¨ âë ¯® x [ª-â x]*65536 + [à §¬¥à]
|
||
mov ecx,12 shl 16+15 ; <20> ç «ìë¥ ª®®à¤¨ âë ¯® y [ª-â y]*65536 + [à §¬¥à]
|
||
int 0x40 ; <20>à¥àë¢ ¨¥ (®á à¨áã¥â ¯àאַ㣮«ì¨ª)
|
||
; value - draw fringle
|
||
mov ebx,34 shl 16+62 ; <20> ç «ìë¥ ª®®à¤¨ âë ¯® x [ª-â x]*65536 + [à §¬¥à]
|
||
mov ecx,16 shl 16+15 ; <20> ç «ìë¥ ª®®à¤¨ âë ¯® y [ª-â y]*65536 + [à §¬¥à]
|
||
int 0x40 ; <20>à¥àë¢ ¨¥ (®á à¨áã¥â ¯àאַ㣮«ì¨ª)
|
||
|
||
; color 2 - draw color
|
||
mov edx,[color] ; 梥â
|
||
mov ebx,12 shl 16+13 ; <20> ç «ìë¥ ª®®à¤¨ âë ¯® x [ª-â x]*65536 + [à §¬¥à]
|
||
mov ecx,13 shl 16+13 ; <20> ç «ìë¥ ª®®à¤¨ âë ¯® y [ª-â y]*65536 + [à §¬¥à]
|
||
int 0x40 ; <20>à¥àë¢ ¨¥ (®á à¨áã¥â ¯àאַ㣮«ì¨ª)
|
||
; value - draw background
|
||
mov edx,0xFFFFFF ; 梥â-ä®
|
||
mov ebx,35 shl 16+60 ; <20> ç «ìë¥ ª®®à¤¨ âë ¯® x [ª-â x]*65536 + [à §¬¥à]
|
||
mov ecx,17 shl 16+13 ; <20> ç «ìë¥ ª®®à¤¨ âë ¯® y [ª-â y]*65536 + [à §¬¥à]
|
||
int 0x40 ; <20>à¥àë¢ ¨¥ (®á à¨áã¥â ¯àאַ㣮«ì¨ª)
|
||
|
||
mov eax,47 ; ”ãªæ¨ï 47 - ¢ë¢®¤ ç¨á« ¢ ®ª®
|
||
mov ecx,[color] ; ç¨á«® (¯à¨ bl=0) ¨«¨ 㪠§ ⥫ì (¯à¨ bl=1)
|
||
mov esi,0x0 ; 0xX0RRGGBB
|
||
mov ebx,256+8 shl 16 ; ¯ à ¬¥âàë ¯à¥®¡à §®¢ ¨ï ç¨á« ¢ ⥪áâ (HEX)
|
||
mov edx,45 shl 16+20 ; [ª®®à¤¨ â ¯® ®á¨ x]*65536 + [ª®®à¤¨ â ¯® ®á¨ y]
|
||
int 0x40 ; <20>à¥àë¢ ¨¥ - ¢ë¢®¤¨¬ १ã«ìâ â ¢ ®ª® (HEX)
|
||
|
||
mov eax,4 ; äãªæ¨ï 4: ¯¨á âì ⥪áâ ¢ ®ª¥
|
||
mov ebx,38*65536+20 ; [x ç «ìë©] *65536 + [y ç «ìë©]
|
||
mov ecx,0x0 ; 梥â ⥪áâ RRGGBB
|
||
mov edx,hex ; à¨á㥬 '#'
|
||
mov esi,1 ; ¤«¨ ⥪áâ ¢ ¡ ©â å
|
||
int 0x40
|
||
|
||
;.................................................................................................
|
||
; Žâà¨á®¢ª r g b § 票©
|
||
;.................................................................................................
|
||
call get_spectr
|
||
|
||
movzx eax,[cred] ; ªà áë©
|
||
mov ebx,9*65536+142 ; [x ç «ìë©] *65536 + [y ç «ìë©]
|
||
call draw_value ; ¢ë¢®¤¨¬ १ã«ìâ â
|
||
|
||
movzx eax,[cgreen] ; §¥«¥ë©
|
||
mov ebx,32*65536+142 ; [x ç «ìë©] *65536 + [y ç «ìë©]
|
||
call draw_value ; ¢ë¢®¤¨¬ १ã«ìâ â
|
||
|
||
movzx eax,[cblue] ; ᨨ©
|
||
mov ebx,55*65536+142 ; [x ç «ìë©] *65536 + [y ç «ìë©]
|
||
call draw_value ; ¢ë¢®¤¨¬ १ã«ìâ â
|
||
|
||
movzx eax,[calpha] ; «ìä
|
||
mov ebx,78*65536+142 ; [x ç «ìë©] *65536 + [y ç «ìë©]
|
||
call draw_value ; ¢ë¢®¤¨¬ १ã«ìâ â
|
||
|
||
;.................................................................................................
|
||
; ‚뢮¤¨¬ ¡ãª¢ë r g b a
|
||
;.................................................................................................
|
||
mov eax,4 ; 4 - ¢ë¢¥á⨠áâபã ⥪áâ ¢ ®ª®
|
||
mov ebx,16 shl 16+40 ; [ª®®à¤¨ â ¯® ®á¨ x]*65536 + [ª®®à¤¨ â ¯® ®á¨ y]
|
||
mov ecx,0x0 ; 0xX0RRGGBB (RR, GG, BB § ¤ îâ 梥â ⥪áâ )
|
||
mov edx,cname ; 㪠§ ⥫ì ç «® áâப¨
|
||
mov esi,1 ; ¢ë¢®¤¨âì esi ᨬ¢®«®¢
|
||
newline: ; 横«
|
||
int 0x40 ; <20>à¥àë¢ ¨¥
|
||
add ebx,23 shl 16 ; „®¡ ¢«ï¥¬
|
||
add edx,1 ; „®¡ ¢«ï¥¬
|
||
cmp [edx],byte 'x' ; ‘à ¢¥¨¥ á ¡ ©â®¬ å
|
||
jne newline ; …᫨ ¥ ã«ì ¨«¨ ¥ à ¢®
|
||
|
||
;.................................................................................................
|
||
; Žâà¨á®¢ª á« ©¤¥à®¢
|
||
;.................................................................................................
|
||
mov eax,13 ; ”ãªæ¨ï 13 - à¨á®¢ âì ¯àאַ㣮«ì¨ª
|
||
mov edx,0x222222 ; 梥â-®¡¢®¤ª¨
|
||
mov ebx,16 shl 16+4 ; <20> ç «ìë¥ ª®®à¤¨ âë ¯® x [ª-â x]*65536 + [à §¬¥à]
|
||
mov ecx,51 shl 16+86 ; <20> ç «ìë¥ ª®®à¤¨ âë ¯® y [ª-â y]*65536 + [à §¬¥à]
|
||
int 0x40
|
||
add ebx,23 shl 16 ; <20> ç «ìë¥ ª®®à¤¨ âë ¯® x [ª-â y]*65536 + [à §¬¥à]
|
||
int 0x40
|
||
add ebx,23 shl 16 ; <20> ç «ìë¥ ª®®à¤¨ âë ¯® x [ª-â y]*65536 + [à §¬¥à]
|
||
int 0x40
|
||
add ebx,23 shl 16 ; <20> ç «ìë¥ ª®®à¤¨ âë ¯® x [ª-â y]*65536 + [à §¬¥à]
|
||
int 0x40
|
||
|
||
mov edx,0xFA0919 ; 梥â-®¡¢®¤ª¨
|
||
mov ebx,17 shl 16+2 ; <20> ç «ìë¥ ª®®à¤¨ âë ¯® x [ª-â x]*65536 + [à §¬¥à]
|
||
mov ecx,52 shl 16+84 ; <20> ç «ìë¥ ª®®à¤¨ âë ¯® y [ª-â y]*65536 + [à §¬¥à]
|
||
int 0x40
|
||
mov edx,0x08CE19 ; 梥â-®¡¢®¤ª¨
|
||
add ebx,23 shl 16 ; <20> ç «ìë¥ ª®®à¤¨ âë ¯® x [ª-â y]*65536 + [à §¬¥à]
|
||
int 0x40
|
||
mov edx,0x0909FF ; 梥â-®¡¢®¤ª¨
|
||
add ebx,23 shl 16 ; <20> ç «ìë¥ ª®®à¤¨ âë ¯® x [ª-â y]*65536 + [à §¬¥à]
|
||
int 0x40
|
||
mov edx,0xE4E4E4 ; 梥â-®¡¢®¤ª¨
|
||
add ebx,23 shl 16 ; <20> ç «ìë¥ ª®®à¤¨ âë ¯® x [ª-â y]*65536 + [à §¬¥à]
|
||
int 0x40
|
||
|
||
;.................................................................................................
|
||
; Žâà¨á®¢ª ¯®«§ãª®¢
|
||
;.................................................................................................
|
||
mov edx,0x0 ; 梥â-¯®«§ãª®¢
|
||
mov ebx,17 shl 16+11 ; <20> ç «ìë¥ ª®®à¤¨ âë ¯® x [ª-â x]*65536 + [à §¬¥à]
|
||
movzx eax,[cred] ; ¡¥à¥¬ § 票¥ 梥â
|
||
call draw_slider
|
||
add ebx,23 shl 16
|
||
movzx eax,[cgreen] ; ¡¥à¥¬ § 票¥ 梥â
|
||
call draw_slider
|
||
add ebx,23 shl 16
|
||
movzx eax,[cblue] ; ¡¥à¥¬ § 票¥ 梥â
|
||
call draw_slider
|
||
add ebx,23 shl 16
|
||
movzx eax,[calpha] ; ¡¥à¥¬ § 票¥ 梥â
|
||
call draw_slider
|
||
|
||
ret ; ‚®§¢à é ¥¬ ã¯à ¢«¥¨¥
|
||
;end_draw_result
|
||
|
||
draw_slider:
|
||
xor ecx,ecx
|
||
mov cl,0x3 ; ¡ã¤¥¬ ¤¥«¨âì ¥£® 3 â ª ª ª ¯®«§ãª¨ ¤«¨®© 85 ¯¨ªá¥«¥©
|
||
div cl ; ¤¥«¨¬ - 楫®¥ ¢ al ®áâ ⮪ ¢ ah
|
||
mov cl,136 ; ¨¦ïï â®çª ¯®«§ãª
|
||
sub cl,al ; cl=cl-al
|
||
shl ecx,16
|
||
add ecx,1 ; § ¤ ¥¬ ç «ì®¥ ¯®«®¦¥¨¥
|
||
mov eax,13 ; ”ãªæ¨ï 13 - à¨á®¢ âì ¯àאַ㣮«ì¨ª
|
||
int 0x40
|
||
push ebx ; á®åà 塞 ¤«ï á«¥¤ãî饣® ¯®«§ãª x+w
|
||
sub ebx,8 ; â ª ª ª è¨à¨ «¨¨¨ 11 â® ®â¨¬ ¥¬ 8 çâ®¡ë ªã¡¨ª áâ « è¨à¨®© 3
|
||
add ebx,8 shl 16 ; Š®®à¤¨ âë ¯® x ¤«ï ª¢ ¤à â ¯®«§ãª¥ á¬¥é ¥¬ 8 ¢ ¯à ¢®
|
||
inc ecx ; ¡ë¤«®ª®¤¨¬ ¢ëá®âã ¯®«§ãª ¤® 3-å (1+1=2)
|
||
inc ecx ; (2+1=3) ã ¢®â ã á ¡ã¤¥â ªã¡¨ª 3å3 8 ¢ ¯à ¢® ®â «¨¨¨
|
||
int 0x40 ; à¨á㥬
|
||
pop ebx ; ¢®ááâ ¢«¨¢ ¥¬ ®à¬ «ìë¥ ª®®à¤¨ âë
|
||
ret ; ‚®§¢à é ¥¬ ã¯à ¢«¥¨¥
|
||
|
||
;end_slider
|
||
|
||
draw_value:
|
||
;.................................................................................................
|
||
; ‚뢮¤ ç¨á« ¨§ áâப¨ ¢ 㪠§ ®© ®¡« áâ¨
|
||
;.................................................................................................
|
||
push ebx ; á®åà 塞 ¯à¨á« ë¥ ª®®à¤¨ âë
|
||
mov ebx,10 ; ãáâ ¢«¨¢ ¥¬ ®á®¢ ¨¥ á¨á⥬ë áç¨á«¥¨ï
|
||
mov edi,buff ; 㪠§ ⥫ì áâப㠡ãä¥à
|
||
call int2ascii ; ª®¢¥àâ¨à㥬 ç¨á«® ¨ «®¦¨¬ ª ª áâப㠢 ¡ãä¥à + esi ¤«¨
|
||
mov eax,4 ; äãªæ¨ï 4: ¯¨á âì ⥪áâ ¢ ®ª¥
|
||
pop ebx ; ¤®áâ ¥¬ ¨§ á⥪ ¯à¨á« ë¥ ª®®à¤¨ âë
|
||
cmp esi,2 ; –…<E28093>’<EFBFBD>ˆ<EFBFBD>Ž‚€<E2809A>ˆ… ’…Š‘’€
|
||
jne draw_value_1
|
||
add ebx,4 shl 16
|
||
jmp draw_value_e
|
||
draw_value_1:
|
||
cmp esi,1
|
||
jne draw_value_e
|
||
add ebx,7 shl 16
|
||
draw_value_e:
|
||
mov ecx,0x0 ; 梥â ⥪áâ RRGGBB
|
||
mov edx,buff ; 㪠§ ⥫ì ç «® ⥪áâ
|
||
int 0x40
|
||
ret ; ‚®§¢à é ¥¬ ã¯à ¢«¥¨¥
|
||
;end_draw_value
|
||
|
||
_read_params:
|
||
|
||
mov al,[params+2]
|
||
mov [params_c+0],al
|
||
|
||
mov al,[params+3]
|
||
mov [params_c+1],al
|
||
|
||
mov al,[params+4]
|
||
mov [params_c+2],al
|
||
|
||
mov al,[params+5]
|
||
mov [params_c+3],al
|
||
|
||
mov al,[params+6]
|
||
mov [params_c+4],al
|
||
|
||
mov al,[params+7]
|
||
mov [params_c+5],al
|
||
|
||
mov al,[params+8]
|
||
mov [params_c+6],al
|
||
|
||
mov al,[params+9]
|
||
mov [params_c+7],al
|
||
|
||
mov esi,params_c
|
||
mov ecx,16
|
||
call ascii2int
|
||
mov [color],eax
|
||
|
||
mov al,[params+11]
|
||
mov [params_c+0],al
|
||
|
||
mov al,[params+12]
|
||
mov [params_c+1],al
|
||
|
||
mov al,[params+13]
|
||
mov [params_c+2],al
|
||
|
||
mov al,[params+14]
|
||
mov [params_c+3],al
|
||
|
||
mov al,[params+15]
|
||
mov [params_c+4],al
|
||
|
||
mov al,[params+16]
|
||
mov [params_c+5],al
|
||
|
||
mov al,[params+17]
|
||
mov [params_c+6],al
|
||
|
||
mov al,[params+18]
|
||
mov [params_c+7],al
|
||
|
||
mov esi,params_c
|
||
mov ecx,16
|
||
call ascii2int
|
||
mov [color2],eax
|
||
|
||
ret
|
||
|
||
hex_digit:
|
||
;.................................................................................................
|
||
; <20>८¡à §®¢ ¨¥ ¢ ASCII (¢¥ § ¢¨á¨¬®á⨠®â á¨á⥬ë áç¨á«¥¨ï)
|
||
;.................................................................................................
|
||
cmp dl,10 ; ¢ dl ®¦¨¤ ¥âáï ç¨á«® ®â 0 ¤® 15
|
||
jb .less ; ¥á«¨ dl<10 â® ¯¥à¥å®¤¨¬
|
||
add dl,'A'-10 ; 10->A 11->B 12->C ...
|
||
ret ; ‚®§¢à é ¥¬ ã¯à ¢«¥¨¥
|
||
.less:
|
||
or dl,'0' ; …᫨ á¨á⥬ áç¨á«¥¨ï 10-ï ¨ ¬¥¥¥
|
||
ret ; ‚®§¢à é ¥¬ ã¯à ¢«¥¨¥
|
||
;end_hex_digit
|
||
|
||
int2ascii:
|
||
;.................................................................................................
|
||
; <20>८¡à §®¢ ¨¥ ç¨á« ¢ áâபã
|
||
;.................................................................................................
|
||
; eax - 32-å § 箥 ç¨á«®
|
||
; ebx - ®á®¢ ¨¥ á¨á⥬ë áç¨á«¥¨ï
|
||
; edi - 㪠§ ⥫ì áâப㠡ãä¥à
|
||
; ‚®§¢à é ¥â § ¯®«¥ë© ¡ãä¥à ¨ esi - ¤«¨ áâப¨
|
||
;pushad
|
||
xor esi,esi ; § ã«ï¥¬ áç¥â稪 ᨬ¢®«®¢
|
||
convert_loop:
|
||
xor edx,edx ; § ã«ï¥¬ ॣ¨áâà ¯®¤ ®áâ ⮪
|
||
div ebx ; eax/ebx - ®áâ ⮪ ¢ edx
|
||
call hex_digit ; ¯à¥®¡à §ã¥¬ ᨬ¢®«
|
||
push edx ; «®¦¨¬ ¢ á⥪
|
||
inc esi ; 㢥«¨ç¨¢ ¥¬ áç¥â稪
|
||
test eax,eax ; ¥á«¨ ¥é¥ ¬®¦® ¤¥«¨âì
|
||
jnz convert_loop ; â® ¤¥«¨¥¬ ¥é¥
|
||
cld ; Ž<>Ÿ‡€’…‹œ<E280B9>Ž á¡à áë¢ ¥¬ ä« £ ¯à ¢«¥¨ï DF (§ ¯¨áì ¢¯¥àñ¤)
|
||
write_loop: ; ¨ ç¥
|
||
pop eax ; ¤®áâ ¥¬ ¨§ á⥪ ¢ ¥ å
|
||
stosb ; § ¯¨áë¢ ¥¬ ¢ ¡ãä¥à ¯® ¤à¥áã ES:(E)DI
|
||
dec esi ; 㬥ìè ¥¬ áç¥â稪
|
||
test esi,esi ; ¥á«¨ ¥áâì çâ® ¤®áâ ¢ âì ¨§ á⥪
|
||
jnz write_loop ; â® ¤®áâ ñ¬
|
||
mov byte [edi],0 ; ¨ ç¥ ¤®¯¨áëë¢ ¥¬ ã«¥¢®© ¡ ©â
|
||
;popad ; ¢®ááâ ¢«¨¢ ¥¬ § 票ï ॣ¨áâ஢
|
||
; ª®¤ ¨¦¥ ¥ ¨¬¥¥â ¨ç¥£® ®¡é¥£® ª äãªæ¨¨, ¯à®áâ® ¢®§¢à é ¥â ¥é¥ ¤«¨ã ¯®«ã祮© áâப¨
|
||
mov edi,buff ; 㪠§ ⥫ì ç «® ⥪áâ
|
||
call str_len
|
||
mov esi,eax
|
||
ret ; ¨ ¢®§¢à é ¥¬ ã¯à ¢«¥¨¥
|
||
;end_int2ascii
|
||
|
||
char2byte:
|
||
sub al,'0'
|
||
cmp al,10
|
||
jb done
|
||
add al,'0'
|
||
and al,0x5f
|
||
sub al,'A'-10
|
||
and al,0x0f
|
||
done:
|
||
ret
|
||
;end_char2byte
|
||
|
||
ascii2int:
|
||
;.................................................................................................
|
||
; <20>८¡à §®¢ ¨¥ áâப¨ ¢ ç¨á«®
|
||
;.................................................................................................
|
||
; esi - 㪠§ ⥫ì ã«ìâ¥à¬¨¨à®¢ ãî áâபã
|
||
; ecx - ®á®¢ ¨¥ á¨á⥬ë áç¨á«¥¨ï
|
||
; ‚®§¢à é ¥â eax - ç¨á«®
|
||
push esi
|
||
xor eax,eax
|
||
xor ebx,ebx
|
||
cmp byte [esi],'-'
|
||
jnz .next
|
||
inc esi
|
||
.next:
|
||
lodsb
|
||
or al,al
|
||
jz .done
|
||
call char2byte
|
||
imul ebx,ecx
|
||
add ebx,eax
|
||
jmp .next
|
||
.done:
|
||
xchg ebx,eax
|
||
pop esi
|
||
cmp byte [esi],'-'
|
||
jz .negate
|
||
ret
|
||
.negate:
|
||
neg eax
|
||
ret
|
||
;end_ascii2int
|
||
|
||
get_spectr:
|
||
;.................................................................................................
|
||
; ¢®§¢à é ¥â r,g,b á®á⮢«ïî騥 梥â
|
||
;.................................................................................................
|
||
mov ecx,[color]
|
||
mov [cblue],cl
|
||
shr ecx,8
|
||
mov [cgreen],cl
|
||
shr ecx,8
|
||
mov [cred],cl
|
||
shr ecx,8
|
||
mov [calpha],cl
|
||
ret ; ¨ ¢®§¢à é ¥¬ ã¯à ¢«¥¨¥
|
||
;end_get_spectr
|
||
|
||
set_spectr:
|
||
;.................................................................................................
|
||
; ãáâ ¢«¨¢ ¥â ¨§ r,g,b 梥â
|
||
;.................................................................................................
|
||
movzx eax,[calpha]
|
||
shl eax,8
|
||
mov al,[cred]
|
||
shl eax,8
|
||
mov al,[cgreen]
|
||
shl eax,8
|
||
mov al,[cblue]
|
||
mov [color],eax
|
||
call draw_result ; ‚뢮¤¨¬ १ã«ìâ â
|
||
ret ; ¨ ¢®§¢à é ¥¬ ã¯à ¢«¥¨¥
|
||
;end_get_spectr
|
||
|
||
str_len:
|
||
;.................................................................................................
|
||
; ®¯à¥¤¥«ï¥â ¤«¨ã áâப¨ (¢å®¤->EDI ZS offset ; ¢ë室->EAX ZS length)
|
||
;.................................................................................................
|
||
push ecx
|
||
push esi
|
||
push edi
|
||
|
||
cld
|
||
xor al, al
|
||
mov ecx, 0FFFFFFFFh
|
||
mov esi, edi
|
||
repne scasb
|
||
sub edi, esi
|
||
mov eax, edi
|
||
dec eax
|
||
|
||
pop edi
|
||
pop esi
|
||
pop ecx
|
||
|
||
ret
|
||
;end_str_len
|
||
|
||
|
||
;-------------------------------
|
||
|
||
proc random uses ebx ecx edx, max_value
|
||
mov ebx, 0
|
||
mov eax, ebx
|
||
or eax, eax
|
||
jnz @f
|
||
rdtsc
|
||
xor eax, edx
|
||
mov ebx, eax
|
||
|
||
@@:
|
||
xor edx, edx
|
||
mov ecx, 127773
|
||
div ecx
|
||
mov ecx, eax
|
||
mov eax, 16807
|
||
mul edx
|
||
mov edx, ecx
|
||
mov ecx, eax
|
||
mov eax, 2836
|
||
mul edx
|
||
sub ecx, eax
|
||
xor edx, edx
|
||
mov eax, ecx
|
||
mov ebx, ecx
|
||
mov ecx, 100000
|
||
div ecx
|
||
mov eax, edx
|
||
|
||
xor edx, edx
|
||
mov ebx, [max_value]
|
||
div ebx
|
||
mov eax, edx
|
||
|
||
ret
|
||
endp
|
||
|
||
set_background2:
|
||
mcall 68, 11
|
||
mcall 68, 12, 256 * 256 * 3
|
||
mov [image], eax
|
||
|
||
mov edx, eax
|
||
mov ecx, 256 * 256
|
||
@@:
|
||
stdcall random, 15 + 1
|
||
sub al, 15 / 2
|
||
|
||
mov bh, byte [color + 0]
|
||
add bh, al
|
||
mov [edx + 0], bh
|
||
mov bh, byte [color + 1]
|
||
add bh, al
|
||
mov [edx + 1], bh
|
||
mov bh, byte [color + 2]
|
||
add bh, al
|
||
mov [edx + 2], bh
|
||
add edx, 3
|
||
loop @b
|
||
|
||
mcall 15, 1, 256, 256
|
||
mcall 15, 4, 1
|
||
mcall 15, 5, [image], 0, 256 * 256 * 3
|
||
mcall 15, 3
|
||
|
||
mcall 68, 13, [image]
|
||
ret
|
||
|
||
;#___________________________________________________________________________________________________
|
||
;****************************************************************************************************|
|
||
; <20>‹ŽŠ <20>…<EFBFBD>…Œ…<C592><E280A6>›• ˆ ŠŽ<C5A0>‘’€<E28099>’ |
|
||
;----------------------------------------------------------------------------------------------------/
|
||
circle:
|
||
title db 'Palitra v0.76',0 ; åà ¨â ¨¬ï ¯à®£à ¬¬ë
|
||
hidden db 'Hidden',0
|
||
hex db '#',0 ; ¤«ï ¢ë¢®¤ à¥èñ⪨ ª ª ⥪áâ
|
||
cname db 'RGBAx' ; åà ¨â à §àï¤ë 梥⮢ (red,green,blue) x-¬¥âª ª®æ
|
||
larrow db 0x1A,0
|
||
buff db '000',0
|
||
bground db 'BACKGROUND',0 ; ¨¬ï ª®¯ª¨ - 14
|
||
bground1 db 'Gradient',0 ; ¨¬ï ª®¯ª¨ - 14
|
||
bground2 db 'Noisy',0 ; ¨¬ï ª®¯ª¨ - 14
|
||
runmode dd 1 ; ०¨¬ § ¯ã᪠(1-normal, 2-hidden, 3-colordialog)
|
||
color2 dd 00FFFFFFh ; åà ¨â § 票¥ ¢â®à®£® ¢ë¡à ®£® 梥â
|
||
|
||
|
||
|
||
I_END:
|
||
cm rb 12
|
||
color rd 1 ; åà ¨â § 票¥ ¢ë¡à ®£® 梥â
|
||
mouse_x rd 1 ; åà ¨â £«®¡ «ìãî å ª®®à¤¨ âã ¬ëè¨
|
||
mouse_y rd 1 ; åà ¨â £«®¡ «ìãî ã ª®®à¤¨ âã ¬ëè¨
|
||
mouse_f rd 1 ; åà ¨â ¤ ë¥ ® ⮬ ª ª ï ª®¯ª ¬ëè¨ ¡ë« ¦ â
|
||
desctop_w rd 1 ; åà ¨â è¨à¨ã íªà
|
||
desctop_h rd 1 ; åà ¨â ¢ëá®âã íªà
|
||
sc system_colors ; åà ¨â áâàãªâãàã á¨á⥬ëå 梥⮢ ᪨
|
||
cred rb 1 ; åà ¨¬ ªà áë© á¯¥ªàâ
|
||
cgreen rb 1 ; åà ¨¬ §¥«¥ë© ᯥªâà
|
||
cblue rb 1 ; åà ¨¬ ᨨ© ᯥªâà
|
||
calpha rb 1 ; åà ¨¬ ¯à®§à ç®áâì
|
||
pnext rd 1 ; áç¥â稪 ¯¥à¥ª«îç¥¨ï ¯ «¨âàë
|
||
renmode rd 1 ; ०¨¬ ®âà¨á®¢ª¨ (1-梥⮢ ï á奬 ,2-¯¨¯¥âª ,3-ªà㣮¢ ï)
|
||
params rb 20 ; ¯à¨ñ¬ ¯ à ¬¥â஢
|
||
params_c rb 9 ; ¯à¨ñ¬¨ª ¤«ï 梥â
|
||
|
||
image rd 1
|
||
|
||
|
||
rd 1024
|
||
I_MEM: |