forked from KolibriOS/kolibrios
KOX: window with skin, system colors for button and text
git-svn-id: svn://kolibrios.org@2734 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
185caf04b2
commit
c876fb5ca5
@ -7,7 +7,7 @@ macro DATA_SECTION
|
|||||||
; „€<EFBFBD><EFBFBD>›… <EFBFBD><EFBFBD>Žƒ<EFBFBD>€ŒŒ›
|
; „€<EFBFBD><EFBFBD>›… <EFBFBD><EFBFBD>Žƒ<EFBFBD>€ŒŒ›
|
||||||
;-----------------------------------------------------------------------------
|
;-----------------------------------------------------------------------------
|
||||||
lootxt: db 'oops! - Looser...' ; los
|
lootxt: db 'oops! - Looser...' ; los
|
||||||
text: db 'KOX v0.003 [ESC] - quit' ; winheader string
|
text:
|
||||||
texts: db 'Congratulations! You are winner.' ; in window win
|
texts: db 'Congratulations! You are winner.' ; in window win
|
||||||
textend: db 'New' ;button id=200
|
textend: db 'New' ;button id=200
|
||||||
px: dw 50 ;x,y -
|
px: dw 50 ;x,y -
|
||||||
@ -63,4 +63,8 @@ idx: dd 0 ;N cell
|
|||||||
dw 001010000b,2
|
dw 001010000b,2
|
||||||
dw 001000100b,4 ;diag
|
dw 001000100b,4 ;diag
|
||||||
|
|
||||||
|
caption db 'KOX v0.1', 0
|
||||||
|
|
||||||
|
colors rd 10
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
;************************************************
|
;************************************************
|
||||||
;* X-0-X / Kolibri OS /
|
;* X-0-X / Kolibri OS /
|
||||||
;************************** 17/10/2007 **********
|
;************************** 17/10/2007 **********
|
||||||
|
;************************** 04/06/2012 **********
|
||||||
|
|
||||||
include 'main.inc'
|
include 'main.inc'
|
||||||
include 'data.inc'
|
include 'data.inc'
|
||||||
include 'macs.inc'
|
include 'macs.inc'
|
||||||
|
@ -1,3 +1,14 @@
|
|||||||
|
|
||||||
|
Kox v0.1
|
||||||
|
----------------
|
||||||
|
’¥―¥ΰμ ®<>® α® α<>¨®¬ ¤«ο <20>®―<C2AE>¨ ¨ β¥<CEB2>αβ ¨α―®«μ§γξβαο α¨αβ¥¬λ¥ ζΆ¥β .
|
||||||
|
|
||||||
|
== 04/06/2012 ==
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Kox v0.003
|
Kox v0.003
|
||||||
----------------
|
----------------
|
||||||
Šà¥á⨪¨-®«¨ª¨ ¢ ª®¬¬¥â à¨ïå ¥ 㦤 îâáï.
|
Šà¥á⨪¨-®«¨ª¨ ¢ ª®¬¬¥â à¨ïå ¥ 㦤 îâáï.
|
||||||
|
@ -7,6 +7,16 @@ cW equ cWHITE
|
|||||||
macro main_loop
|
macro main_loop
|
||||||
{
|
{
|
||||||
|
|
||||||
|
; <EFBFBD>®«ãç¨âì áâ ¤ àâë¥ æ¢¥â ®ª®
|
||||||
|
;========================================
|
||||||
|
mov eax, 48
|
||||||
|
mov ebx, 3
|
||||||
|
mov ecx, colors
|
||||||
|
mov edx, 40
|
||||||
|
int 0x40
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; äãªæ¨ï ®âà¨á®¢ª¨ ®ª
|
; äãªæ¨ï ®âà¨á®¢ª¨ ®ª
|
||||||
;========================================
|
;========================================
|
||||||
draw_window:
|
draw_window:
|
||||||
@ -17,18 +27,12 @@ draw_window:
|
|||||||
mov eax,0 ; äãªæ¨ï 0: ®¯à¥¤¥«¨âì ¨ ¢ë¢¥á⨠®ª®
|
mov eax,0 ; äãªæ¨ï 0: ®¯à¥¤¥«¨âì ¨ ¢ë¢¥á⨠®ª®
|
||||||
mov ebx,100*65536+250 ; [x ç «ìë©] *65536 + [x à §¬¥à]
|
mov ebx,100*65536+250 ; [x ç «ìë©] *65536 + [x à §¬¥à]
|
||||||
mov ecx,ebx ;,100*65536+250 ; [y ç «ìë©] *65536 + [y à §¬¥à]
|
mov ecx,ebx ;,100*65536+250 ; [y ç «ìë©] *65536 + [y à §¬¥à]
|
||||||
mov edx,0x02FFFFFF
|
mov edx, 0x34FFFFFF
|
||||||
|
|
||||||
mov esi, 0x808899AA ; 梥⠧ £®«®¢ª RRGGBB
|
mov esi, 0x808899AA ; 梥⠧ £®«®¢ª RRGGBB
|
||||||
mov edi,0xFFAAcc ; 梥â à ¬ª¨ RRGGBB
|
mov edi, caption ; § £®«®¢®ª
|
||||||
int 0x40
|
|
||||||
; <EFBFBD>€„<EFBFBD>ˆ‘œ ¢ § £®«®¢ª¥ KOX v0.001
|
|
||||||
mov eax,4 ; äãªæ¨ï 4: ¯¨á âì ⥪áâ ¢ ®ª¥
|
|
||||||
mov ebx,8*65536+8 ; [x ç «ìë©] *65536 + [y ç «ìë©]
|
|
||||||
mov ecx,0x00224422 ; 梥â ⥪áâ RRGGBB
|
|
||||||
mov edx,text ; 㪠§ ⥫ì ç «® ⥪áâ
|
|
||||||
mov esi,texts-text ; ¤«¨ ⥪áâ ¢ ¡ ©â å
|
|
||||||
int 0x40
|
int 0x40
|
||||||
|
|
||||||
;-----------------------------------#-----------------------------------------
|
;-----------------------------------#-----------------------------------------
|
||||||
; SCENE OF GAME - PLAY YARD - BOARD - DESK - PLAYING FIELD
|
; SCENE OF GAME - PLAY YARD - BOARD - DESK - PLAYING FIELD
|
||||||
;---------------
|
;---------------
|
||||||
@ -37,23 +41,16 @@ draw_window:
|
|||||||
; ----Š<EFBFBD>Ž<EFBFBD>Šˆ----
|
; ----Š<EFBFBD>Ž<EFBFBD>Šˆ----
|
||||||
;-------------------------------------------------------------------------------
|
;-------------------------------------------------------------------------------
|
||||||
;buttons:
|
;buttons:
|
||||||
mov eax,8 ; äãªæ¨ï 8: ®¯à¥¤¥«¨âì ¨ ¢ë¢¥á⨠ª®¯ªã
|
|
||||||
mov ebx,230*65536+12 ; [x ç «ìë©] *65536 + [x à §¬¥à]
|
|
||||||
mov ecx,5*65536+12 ; [y ç «ìë©] *65536 + [y à §¬¥à]
|
|
||||||
mov edx,100 ; ¨¤¥â¨ä¨ª â®à ª®¯ª¨ =100
|
|
||||||
mov esi,0xFF6611 ; 梥⠪®¯ª¨ RRGGBB
|
|
||||||
int 0x40 ; ===Š<EFBFBD>Ž<EFBFBD>Š€ ‡€Š<EFBFBD>›’ˆŸ ŽŠ<EFBFBD>€===
|
|
||||||
;--------------------------------------------
|
|
||||||
mov eax,8 ;
|
mov eax,8 ;
|
||||||
mov ebx,200*65536+35 ; ;
|
mov ebx,200*65536+35 ;
|
||||||
mov ecx,25*65536+20 ;
|
mov ecx,15*65536+20 ;
|
||||||
mov edx,200 ;== NEW GAME ==
|
mov edx,200 ;== NEW GAME ==
|
||||||
mov esi,0xCC66CC
|
mov esi, [colors+0x18]
|
||||||
int 0x40
|
int 0x40
|
||||||
;--------------------------------------------
|
;--------------------------------------------
|
||||||
mov eax,4 ; ¯¨á âì ⥪áâ ª®¯ª¥ NEW
|
mov eax,4 ; ¯¨á âì ⥪áâ ª®¯ª¥ NEW
|
||||||
mov ebx,210*65536+30
|
mov ebx,210*65536+20
|
||||||
mov ecx,cB
|
mov ecx,[colors+0x1C]
|
||||||
mov edx,textend
|
mov edx,textend
|
||||||
mov esi,3
|
mov esi,3
|
||||||
int 0x40
|
int 0x40
|
||||||
@ -88,8 +85,6 @@ redraw:
|
|||||||
key:
|
key:
|
||||||
mov eax,2 ; áç¨âë¢ ¥¬ ª®¤ ¦ ⮩ ª« ¢¨è¨. ‚®§¢à é¥ ¢ ah.
|
mov eax,2 ; áç¨âë¢ ¥¬ ª®¤ ¦ ⮩ ª« ¢¨è¨. ‚®§¢à é¥ ¢ ah.
|
||||||
int 0x40 ; Š« ¢¨è ¤®«¦ ¡ëâì ¯à®ç¨â ¤«ï ®ç¨á⪨
|
int 0x40 ; Š« ¢¨è ¤®«¦ ¡ëâì ¯à®ç¨â ¤«ï ®ç¨á⪨
|
||||||
cmp ah,27
|
|
||||||
je clos0 ; exit on ESC
|
|
||||||
jmp event_wait ; ¢®§¢à â ª event_wait
|
jmp event_wait ; ¢®§¢à â ª event_wait
|
||||||
button:
|
button:
|
||||||
mov eax,17 ; áç¨âë¢ ¥¬ ¨¤¥â¨ä¨ª â®à ¦ ⮩ ª®¯ª¨
|
mov eax,17 ; áç¨âë¢ ¥¬ ¨¤¥â¨ä¨ª â®à ¦ ⮩ ª®¯ª¨
|
||||||
@ -97,7 +92,7 @@ button:
|
|||||||
;-------------------------------------------------------------------------------
|
;-------------------------------------------------------------------------------
|
||||||
; ᬮâਬ, ª ª ï ª®¯ª ¡ë« ¦ â ¨ ᮮ⢥âáâ¢ãî騬 ®¡à §®¬ ॠ£¨à㥬.
|
; ᬮâਬ, ª ª ï ª®¯ª ¡ë« ¦ â ¨ ᮮ⢥âáâ¢ãî騬 ®¡à §®¬ ॠ£¨à㥬.
|
||||||
;-------------------------------------------------------------------------------
|
;-------------------------------------------------------------------------------
|
||||||
cmp ah,100 ; ª®¯ª á id=100("§ ªàëâì")?
|
cmp ah, 1 ; ª®¯ª á id=1 ("§ ªàëâì")?
|
||||||
jne noclose ;
|
jne noclose ;
|
||||||
clos0: ;
|
clos0: ;
|
||||||
mov eax,-1 ; äãªæ¨ï -1: § ¢¥àè¨âì ¯à®£à ¬¬ã
|
mov eax,-1 ; äãªæ¨ï -1: § ¢¥àè¨âì ¯à®£à ¬¬ã
|
||||||
@ -220,7 +215,7 @@ button:
|
|||||||
|
|
||||||
mov eax,4 ; ä㪠4: ¯¨á âì ⥪áâ 'WINNER!'
|
mov eax,4 ; ä㪠4: ¯¨á âì ⥪áâ 'WINNER!'
|
||||||
mov ebx,18*65536+215 ; [x ç] *65536 + [y ç]
|
mov ebx,18*65536+215 ; [x ç] *65536 + [y ç]
|
||||||
mov ecx,0x10FF22FF ; 梥â ⥪áâ RRGGBB
|
mov ecx, [colors+0x20] ; 梥â ⥪áâ RRGGBB
|
||||||
mov edx,texts ; 㪠§ ⥫ì ç «® ⥪áâ
|
mov edx,texts ; 㪠§ ⥫ì ç «® ⥪áâ
|
||||||
mov esi,textend-texts ; ¤«¨ ⥪áâ ¢ ¡ ©â å
|
mov esi,textend-texts ; ¤«¨ ⥪áâ ¢ ¡ ©â å
|
||||||
int 0x40 ;
|
int 0x40 ;
|
||||||
@ -251,8 +246,8 @@ button:
|
|||||||
@@:
|
@@:
|
||||||
mov dword[idx],esi ;á®åà ¨¬ ¢ idx
|
mov dword[idx],esi ;á®åà ¨¬ ¢ idx
|
||||||
;esi=0..8 - index
|
;esi=0..8 - index
|
||||||
call o_com ;¯à®¢¥àª 24åê ª®¬¡¨ 権 XX0
|
call o_com ;¯à®¢¥àª 24å ª®¬¡¨ 権 XX0
|
||||||
call x_com ;¯à®¢¥àª 24åê ª®¬¡¨ 権 00*
|
call x_com ;¯à®¢¥àª 24å ª®¬¡¨ 権 00*
|
||||||
|
|
||||||
mov esi,dword[idx] ;idx-¨¤¥ªá ª«¥âª¨(0..8) ªã¤ 室
|
mov esi,dword[idx] ;idx-¨¤¥ªá ª«¥âª¨(0..8) ªã¤ 室
|
||||||
shl esi,2 ; esi*4 - ¯®«¥ á®á⮨⠨§ § ¯¨á¥© ¯® dword
|
shl esi,2 ; esi*4 - ¯®«¥ á®á⮨⠨§ § ¯¨á¥© ¯® dword
|
||||||
@ -278,7 +273,7 @@ button:
|
|||||||
|
|
||||||
mov eax,4 ; ä㪠4: ¯¨á âì ⥪áâ 'LOOSER!'
|
mov eax,4 ; ä㪠4: ¯¨á âì ⥪áâ 'LOOSER!'
|
||||||
mov ebx,48*65536+215 ; [x ç] *65536 + [y ç]
|
mov ebx,48*65536+215 ; [x ç] *65536 + [y ç]
|
||||||
mov ecx,0x10FF22FF ; 梥â ⥪áâ RRGGBB
|
mov ecx, [colors+0x20] ; 梥â ⥪áâ RRGGBB
|
||||||
mov edx,lootxt ; 㪠§ ⥫ì ç «® ⥪áâ
|
mov edx,lootxt ; 㪠§ ⥫ì ç «® ⥪áâ
|
||||||
mov esi,text-lootxt ; ¤«¨ ⥪áâ ¢ ¡ ©â å
|
mov esi,text-lootxt ; ¤«¨ ⥪áâ ¢ ¡ ©â å
|
||||||
int 0x40 ;
|
int 0x40 ;
|
||||||
|
Loading…
Reference in New Issue
Block a user