mirror of
https://github.com/KolibriOS/kolibrios.git
synced 2024-12-22 14:52:39 +03:00
065b8d32b2
git-svn-id: svn://kolibrios.org@31 a494cfbc-eb01-0410-851d-a64ba20cac60
178 lines
5.7 KiB
NASM
178 lines
5.7 KiB
NASM
;
|
||
; <20>ਬ¥à ¯à®£à ¬¬ë ¤«ï MenuetOS
|
||
; ®§¢ã稢 ¥â ª®¤ ¦ ⮩ ª« ¢¨è¨ ;)
|
||
;
|
||
; Š®¬¯¨«¨à®¢ âì FASM'®¬
|
||
;
|
||
; ‘¬. â ª¦¥:
|
||
; template.asm - ¯à¨¬¥à ¯à®á⥩襩 ¯à®£à ¬¬ë (®¢ë©!)
|
||
; rb.asm - ª®â¥ªá⮥ ¬¥î à ¡®ç¥£® á⮫
|
||
; example2.asm - ¯à¨¬¥à ¬¥î ¨ ¤®¯®«¨â¥«ìëå ®ª®
|
||
; example3.asm - ¯à¨¬¥à ¬¥î, ॠ«¨§®¢ ®£® ¯®-¤à㣮¬ã
|
||
;---------------------------------------------------------------------
|
||
|
||
use32 ; ¢ª«îç¨âì 32-¡¨âë© à¥¦¨¬ áᥬ¡«¥à
|
||
org 0x0 ; ¤à¥á æ¨ï á ã«ï
|
||
|
||
db 'MENUET01' ; 8-¡ ©âë© ¨¤¥â¨ä¨ª â®à MenuetOS
|
||
dd 0x01 ; ¢¥àá¨ï § £®«®¢ª (¢á¥£¤ 1)
|
||
dd START ; ¤à¥á ¯¥à¢®© ª®¬ ¤ë
|
||
dd I_END ; à §¬¥à ¯à®£à ¬¬ë
|
||
dd 0x1000 ; ª®«¨ç¥á⢮ ¯ ¬ïâ¨
|
||
dd 0x1000 ; ¤à¥á ¢¥àè¨ë áâíª
|
||
dd 0x0 ; ¤à¥á ¡ãä¥à ¤«ï ¯ à ¬¥â஢ (¥ ¨á¯®«ì§ã¥âáï)
|
||
dd 0x0 ; § १¥à¢¨à®¢ ®
|
||
|
||
include 'lang.inc'
|
||
include 'macros.inc' ; ¬ ªà®áë ®¡«¥£ç îâ ¦¨§ì áᥬ¡«¥à騪®¢!
|
||
|
||
;---------------------------------------------------------------------
|
||
;--- <20>€—€‹Ž <20><>Žƒ<C5BD>€ŒŒ› ----------------------------------------------
|
||
;---------------------------------------------------------------------
|
||
|
||
START:
|
||
|
||
red: ; ¯¥à¥à¨á®¢ âì ®ª®
|
||
|
||
call draw_window ; ¢ë§ë¢ ¥¬ ¯à®æ¥¤ãàã ®âà¨á®¢ª¨ ®ª
|
||
|
||
;---------------------------------------------------------------------
|
||
;--- –ˆŠ‹ Ž<><C5BD>€<EFBFBD>Ž’Šˆ ‘Ž<E28098>›’ˆ‰ ----------------------------------------
|
||
;---------------------------------------------------------------------
|
||
|
||
still:
|
||
mcall 10 ; äãªæ¨ï 10 - ¦¤ âì ᮡëâ¨ï
|
||
|
||
cmp eax,1 ; ¯¥à¥à¨á®¢ âì ®ª® ?
|
||
je red ; ¥á«¨ ¤ - ¬¥âªã red
|
||
cmp eax,2 ; ¦ â ª« ¢¨è ?
|
||
je key ; ¥á«¨ ¤ - key
|
||
cmp eax,3 ; ¦ â ª®¯ª ?
|
||
je button ; ¥á«¨ ¤ - button
|
||
|
||
jmp still ; ¥á«¨ ¤à㣮¥ ᮡë⨥ - ¢ ç «® 横«
|
||
|
||
|
||
;---------------------------------------------------------------------
|
||
|
||
|
||
key: ; ¦ â ª« ¢¨è ª« ¢¨ âãà¥
|
||
mcall 2 ; äãªæ¨ï 2 - áç¨â âì ª®¤ ᨬ¢®« (¢ ah)
|
||
|
||
mov [Music+1], ah ; § ¯¨á âì ª®¤ ᨬ¢®« ª ª ª®¤ ®âë
|
||
|
||
; äãªæ¨ï 55-55: á¨áâ¥¬ë© ¤¨ ¬¨ª ("PlayNote")
|
||
; esi - ¤à¥á ¬¥«®¤¨¨
|
||
|
||
; mov eax,55
|
||
; mov ebx,eax
|
||
; mov esi,Music
|
||
; int 0x40
|
||
|
||
; ¨«¨ ª®à®âª®:
|
||
mcall 55, eax, , , Music
|
||
|
||
jmp still ; ¢¥àãâìáï ª ç «ã 横«
|
||
|
||
;---------------------------------------------------------------------
|
||
|
||
button:
|
||
mcall 17 ; 17 - ¯®«ãç¨âì ¨¤¥â¨ä¨ª â®à ¦ ⮩ ª®¯ª¨
|
||
|
||
cmp ah, 1 ; ¥á«¨ <20>… ¦ â ª®¯ª á ®¬¥à®¬ 1,
|
||
jne still ; ¢¥àãâìáï
|
||
|
||
.exit:
|
||
mcall -1 ; ¨ ç¥ ª®¥æ ¯à®£à ¬¬ë
|
||
|
||
|
||
|
||
;---------------------------------------------------------------------
|
||
;--- Ž<><C5BD>…„…‹…<E280B9>ˆ… ˆ Ž’<C5BD>ˆ‘Ž‚Š€ ŽŠ<C5BD>€ ----------------------------------
|
||
;---------------------------------------------------------------------
|
||
|
||
draw_window:
|
||
|
||
mcall 12, 1 ; äãªæ¨ï 12: á®®¡é¨âì Ž‘ ®¡ ®âà¨á®¢ª¥ ®ª
|
||
; 1 - ç¨ ¥¬ à¨á®¢ âì
|
||
|
||
; ¤ «¥¥: á ç « ¤«¨ë© ¢ ਠâ (§ ª®¬¬¥â¨à®¢ ë©)
|
||
; § ⥬ ª®à®âª¨© «®£ á ¨á¯®«ì§®¢ ¨¥¬ ¬ ªà®á®¢
|
||
|
||
|
||
; ‘Ž‡„€ðŒ ŽŠ<C5BD>Ž
|
||
; mov eax,0 ; äãªæ¨ï 0 : ®¯à¥¤¥«¨âì ¨ ®âà¨á®¢ âì ®ª®
|
||
; mov ebx,200*65536+200 ; [x áâ àâ] *65536 + [x à §¬¥à]
|
||
; mov ecx,200*65536+100 ; [y áâ àâ] *65536 + [y à §¬¥à]
|
||
; mov edx,0x02aabbcc ; 梥â à ¡®ç¥© ®¡« á⨠RRGGBB,8->color gl
|
||
; mov esi,0x805080d0 ; 梥⠯®«®áë § £®«®¢ª RRGGBB,8->color gl
|
||
; mov edi,0x005080d0 ; 梥â à ¬ª¨ RRGGBB
|
||
; int 0x40
|
||
|
||
mcall 0, <200,200>, <200,50>, 0x02AABBCC, 0x805080D0, 0x005080D0
|
||
|
||
; ‡€ƒŽ‹Ž‚ŽŠ ŽŠ<C5BD>€
|
||
; mov eax,4 ; äãªæ¨ï 4 : ¯¨á âì ¢ ®ª¥ ⥪áâ
|
||
; mov ebx,8*65536+8 ; [x] *65536 + [y]
|
||
; mov ecx,0x10ddeeff ; èà¨äâ 1 ¨ 梥â ( 0xF0RRGGBB )
|
||
; mov edx,header ; ¤à¥á áâப¨
|
||
; mov esi,header.size ; ¨ ¥ñ ¤«¨
|
||
; int 0x40
|
||
|
||
mcall 4, <8,8>, 0x10DDEEFF, header, header.size
|
||
|
||
; mov eax,4
|
||
; mov ebx,8 shl 16 + 30
|
||
; mov ecx,0
|
||
; mov edx,message
|
||
; mov esi,message.size
|
||
; int 0x40
|
||
|
||
mcall 4, <8, 30>, 0, message, message.size
|
||
|
||
; Š<>Ž<EFBFBD>Š€ ‡€Š<E282AC>›’ˆŸ ŽŠ<C5BD>€
|
||
; mov eax,8 ; äãªæ¨ï 8 : ®¯à¥¤¥«¨âì ¨ à¨á®¢ âì ª®¯ªã
|
||
; mov ebx,(200-19)*65536+12 ; [x áâ àâ] *65536 + [x à §¬¥à]
|
||
; mov ecx,5*65536+12 ; [y áâ àâ] *65536 + [y à §¬¥à]
|
||
; mov edx,1 ; ¨¤¥â¨ä¨ª â®à ª®¯ª¨ - 1
|
||
; mov esi,0x6688dd ; 梥⠪®¯ª¨ RRGGBB
|
||
; int 0x40
|
||
|
||
mcall 8, <200-19, 12>, <5, 12>, 1, 0x6688DD
|
||
|
||
mcall 12, 2 ; äãªæ¨ï 12: á®®¡é¨âì Ž‘ ®¡ ®âà¨á®¢ª¥ ®ª
|
||
; 2, § ª®ç¨«¨ à¨á®¢ âì
|
||
|
||
ret ; ¢ë室¨¬ ¨§ ¯à®æ¥¤ãàë
|
||
|
||
|
||
;---------------------------------------------------------------------
|
||
;--- „€<E2809E><E282AC>›… <20><>Žƒ<C5BD>€ŒŒ› ----------------------------------------------
|
||
;---------------------------------------------------------------------
|
||
|
||
; ‚®â â ª ï ¢®â ª®à®âª ï "¬¥«®¤¨ï".
|
||
; ‚â®à®© ¡ ©â ¨§¬¥ï¥âáï ¦ ⨥¬ ª« ¢¨èë
|
||
|
||
Music:
|
||
db 0x90, 0x30, 0
|
||
|
||
|
||
;---------------------------------------------------------------------
|
||
|
||
; ¨â¥àä¥©á ¯à®£à ¬¬ë ¬®£®ï§ëçë©
|
||
; ‚ë ¬®¦¥â¥ § ¤ âì ï§ëª ¢ MACROS.INC (lang fix ï§ëª)
|
||
|
||
lsz message,\
|
||
ru,'<27> ¦¬¨â¥ «î¡ãî ª« ¢¨èã...',\
|
||
en,'Press any key...',\
|
||
fr,'Pressez une touche...'
|
||
|
||
lsz header,\
|
||
ru,'<27><>ˆŒ…<C592> <20><>Žƒ<C5BD>€ŒŒ›',\
|
||
en,'EXAMPLE APPLICATION',\
|
||
fr,"L'exemplaire programme"
|
||
|
||
;---------------------------------------------------------------------
|
||
|
||
I_END: ; ¬¥âª ª®æ ¯à®£à ¬¬ë
|