2011-01-29 23:35:52 +01:00
|
|
|
|
;#**************************
|
|
|
|
|
;#* X-0-X = MAIN()
|
|
|
|
|
;#************************** 21/10/2007
|
|
|
|
|
cB equ cBLACK
|
|
|
|
|
cW equ cWHITE
|
|
|
|
|
|
|
|
|
|
macro main_loop
|
|
|
|
|
{
|
|
|
|
|
|
2012-06-04 10:11:24 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>⠭<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 梥<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;========================================
|
|
|
|
|
mov eax, 48
|
|
|
|
|
mov ebx, 3
|
|
|
|
|
mov ecx, colors
|
|
|
|
|
mov edx, 40
|
|
|
|
|
int 0x40
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-29 23:35:52 +01:00
|
|
|
|
; <EFBFBD>㭪<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ᮢ<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;========================================
|
|
|
|
|
draw_window:
|
|
|
|
|
mov eax,12 ; <EFBFBD>㭪<EFBFBD><EFBFBD><EFBFBD> 12: ᮮ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>⥬<EFBFBD>
|
|
|
|
|
mov ebx,1 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD>㭪<EFBFBD><EFBFBD><EFBFBD> 1, <EFBFBD><EFBFBD>砫<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ᮢ<EFBFBD><EFBFBD>
|
|
|
|
|
int 0x40
|
|
|
|
|
; ===== <EFBFBD><EFBFBD><EFBFBD><EFBFBD> !!!
|
|
|
|
|
mov eax,0 ; <EFBFBD>㭪<EFBFBD><EFBFBD><EFBFBD> 0: <EFBFBD><EFBFBD>।<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD>뢥<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov ebx,100*65536+250 ; [x <EFBFBD><EFBFBD>砫<EFBFBD><EFBFBD><EFBFBD><EFBFBD>] *65536 + [x ࠧ<EFBFBD><EFBFBD><EFBFBD>]
|
|
|
|
|
mov ecx,ebx ;,100*65536+250 ; [y <EFBFBD><EFBFBD>砫<EFBFBD><EFBFBD><EFBFBD><EFBFBD>] *65536 + [y ࠧ<EFBFBD><EFBFBD><EFBFBD>]
|
2012-06-04 10:11:24 +02:00
|
|
|
|
mov edx, 0x34FFFFFF
|
2011-01-29 23:35:52 +01:00
|
|
|
|
|
2012-06-04 10:11:24 +02:00
|
|
|
|
mov esi, 0x808899AA ; 梥<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> RRGGBB
|
|
|
|
|
mov edi, caption ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2011-01-29 23:35:52 +01:00
|
|
|
|
int 0x40
|
2012-06-04 10:11:24 +02:00
|
|
|
|
|
2011-01-29 23:35:52 +01:00
|
|
|
|
;-----------------------------------#-----------------------------------------
|
|
|
|
|
; SCENE OF GAME - PLAY YARD - BOARD - DESK - PLAYING FIELD
|
|
|
|
|
;---------------
|
|
|
|
|
playing_field ;macro in macs.inc
|
|
|
|
|
;-------------------------------------------------------------------------------
|
|
|
|
|
; ----<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>----
|
|
|
|
|
;-------------------------------------------------------------------------------
|
|
|
|
|
;buttons:
|
|
|
|
|
mov eax,8 ;
|
2012-06-04 10:11:24 +02:00
|
|
|
|
mov ebx,200*65536+35 ;
|
|
|
|
|
mov ecx,15*65536+20 ;
|
2011-01-29 23:35:52 +01:00
|
|
|
|
mov edx,200 ;== NEW GAME ==
|
2012-06-04 10:11:24 +02:00
|
|
|
|
mov esi, [colors+0x18]
|
2011-01-29 23:35:52 +01:00
|
|
|
|
int 0x40
|
|
|
|
|
;--------------------------------------------
|
|
|
|
|
mov eax,4 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ⥪<EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> NEW
|
2012-06-04 10:11:24 +02:00
|
|
|
|
mov ebx,210*65536+20
|
|
|
|
|
mov ecx,[colors+0x1C]
|
2011-01-29 23:35:52 +01:00
|
|
|
|
mov edx,textend
|
|
|
|
|
mov esi,3
|
|
|
|
|
int 0x40
|
|
|
|
|
endbut:
|
|
|
|
|
mov eax,12
|
|
|
|
|
mov ebx,2
|
|
|
|
|
int 0x40
|
|
|
|
|
;============================= draw_window: END
|
|
|
|
|
event_wait:
|
|
|
|
|
mov eax,23 ;==<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>==
|
|
|
|
|
mov ebx,100 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᥪ㭤<EFBFBD>
|
|
|
|
|
int 0x40
|
|
|
|
|
;-------------------------------------------------------------------------------
|
|
|
|
|
; ⨯ ᮡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> eax, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>塞, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᮡ<EFBFBD>⨥ <EFBFBD>ந<EFBFBD><EFBFBD>諮
|
|
|
|
|
;-------------------------------------------------------------------------------
|
|
|
|
|
cmp eax,1 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ᮢ<EFBFBD><EFBFBD>?
|
|
|
|
|
je redraw
|
|
|
|
|
cmp eax,2 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?
|
|
|
|
|
je key
|
|
|
|
|
cmp eax,3 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ணࠬ<EFBFBD><EFBFBD>?
|
|
|
|
|
je button
|
|
|
|
|
cmp eax,6 ; mouse - click or move?
|
|
|
|
|
je MOUSE
|
|
|
|
|
jmp event_wait ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>頥<EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD>砫<EFBFBD> 横<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᮡ<EFBFBD>⨩
|
|
|
|
|
; <EFBFBD> ᮡ<EFBFBD>⨩ <EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;-------------------------------------------------------------------------------
|
|
|
|
|
; <EFBFBD><EFBFBD>ࠡ<EFBFBD>⪠ ᮡ<EFBFBD>⨩
|
|
|
|
|
;-------------------------------------------------------------------------------
|
|
|
|
|
redraw:
|
|
|
|
|
call draw_window ; <EFBFBD><EFBFBD><EFBFBD>뢠<EFBFBD><EFBFBD> <EFBFBD>㭪<EFBFBD><EFBFBD><EFBFBD> draw_window <EFBFBD>
|
|
|
|
|
jmp event_wait ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>頥<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> 横<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
key:
|
|
|
|
|
mov eax,2 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD>뢠<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>⮩ <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>饭 <EFBFBD> ah.
|
|
|
|
|
int 0x40 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⠭<EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>⪨
|
|
|
|
|
jmp event_wait ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> event_wait
|
|
|
|
|
button:
|
|
|
|
|
mov eax,17 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD>뢠<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䨪<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>⮩ <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
int 0x40 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>饭 <EFBFBD> ah.
|
|
|
|
|
;-------------------------------------------------------------------------------
|
|
|
|
|
; ᬮ<EFBFBD>ਬ, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>뫠 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> ᮮ⢥<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>騬 <EFBFBD><EFBFBD>ࠧ<EFBFBD><EFBFBD> ॠ<EFBFBD><EFBFBD><EFBFBD>㥬.
|
|
|
|
|
;-------------------------------------------------------------------------------
|
2012-06-04 10:11:24 +02:00
|
|
|
|
cmp ah, 1 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> id=1 ("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")?
|
2011-01-29 23:35:52 +01:00
|
|
|
|
jne noclose ;
|
|
|
|
|
clos0: ;
|
|
|
|
|
mov eax,-1 ; <EFBFBD>㭪<EFBFBD><EFBFBD><EFBFBD> -1: <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ணࠬ<EFBFBD><EFBFBD>
|
|
|
|
|
int 0x40 ;
|
|
|
|
|
noclose: ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> id=200( "New" )
|
|
|
|
|
mov dword[pox],0
|
|
|
|
|
mov dword[pox+4],0 ;clear memory
|
|
|
|
|
mov dword[pox_],0 ;rest and other stuff
|
|
|
|
|
mov word[poxl],0 ; bits of pole X
|
|
|
|
|
mov word[pool],0 ; bits of pole O
|
|
|
|
|
;mov byte[fill],0 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>塞 <EFBFBD><EFBFBD><EFBFBD><EFBFBD>稪 室<EFBFBD><EFBFBD>
|
|
|
|
|
;mov byte[xwin],0 ; flag - x winner
|
|
|
|
|
;mov byte[owin],0 ; flag - o winner
|
|
|
|
|
jmp redraw ; <EFBFBD><EFBFBD><EFBFBD>⮥ <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> ==>>
|
|
|
|
|
;-------------------------------------------------------------------------------
|
|
|
|
|
; ᬮ<EFBFBD>ਬ, <EFBFBD><EFBFBD><EFBFBD> <EFBFBD>뫠 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;-------------------------------------------------------------------------------
|
|
|
|
|
MOUSE:
|
|
|
|
|
mov eax,37 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>..
|
|
|
|
|
mov ebx,2
|
|
|
|
|
int 0x40
|
|
|
|
|
cmp eax,0 ; ..<EFBFBD><EFBFBD>祣<EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᮡ<EFBFBD>⨩
|
|
|
|
|
je event_wait
|
|
|
|
|
;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov eax,37 ; cursor coords
|
|
|
|
|
mov ebx,1
|
|
|
|
|
int 0x40 ;eax=x*65536+y
|
|
|
|
|
mov [px],eax ;[px][py] - <EFBFBD><EFBFBD><EFBFBD>न<EFBFBD><EFBFBD><EFBFBD><EFBFBD> ⪭<EFBFBD>⮣<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
xor eax,eax
|
|
|
|
|
g11: ;1st cell======
|
|
|
|
|
cmp word[px],92
|
|
|
|
|
ja g12 ;>92
|
|
|
|
|
cmp word[py],92
|
|
|
|
|
ja g12 ;>92
|
|
|
|
|
|
|
|
|
|
;mov dword[idx],0 ;N=(0..8)
|
|
|
|
|
jmp puts
|
|
|
|
|
|
|
|
|
|
g12: ;2nd cell========
|
|
|
|
|
inc al
|
|
|
|
|
cmp word[py],145
|
|
|
|
|
ja g13 ;>142
|
|
|
|
|
cmp word[px],92
|
|
|
|
|
ja g13 ;>92
|
|
|
|
|
;mov dword[idx],1 ;N=(0..8)
|
|
|
|
|
jmp puts
|
|
|
|
|
g13: ;3=========
|
|
|
|
|
inc al
|
|
|
|
|
cmp word[px],92
|
|
|
|
|
ja g21 ;>92
|
|
|
|
|
;mov dword[idx],2 ;N=(0..8)
|
|
|
|
|
jmp puts
|
|
|
|
|
g21: ;4========
|
|
|
|
|
inc al
|
|
|
|
|
cmp word[px],145
|
|
|
|
|
ja g22
|
|
|
|
|
cmp word[py],92
|
|
|
|
|
ja g22
|
|
|
|
|
;mov dword[idx],3 ;N=(0..8)
|
|
|
|
|
jmp puts
|
|
|
|
|
g22: ;5=======
|
|
|
|
|
inc al
|
|
|
|
|
cmp word[px],145
|
|
|
|
|
ja g23
|
|
|
|
|
cmp word[py],145
|
|
|
|
|
ja g23
|
|
|
|
|
;mov dword[idx],4 ;N=(0..8)
|
|
|
|
|
jmp puts
|
|
|
|
|
g23: ;6=======
|
|
|
|
|
inc al
|
|
|
|
|
cmp word[px],142
|
|
|
|
|
ja g31 ;>142
|
|
|
|
|
;mov dword[idx],5 ;N=(0..8)
|
|
|
|
|
jmp puts
|
|
|
|
|
g31: ;7=======
|
|
|
|
|
inc al
|
|
|
|
|
cmp word[py],92
|
|
|
|
|
ja g32
|
|
|
|
|
;mov dword[idx],6 ;N=(0..8)
|
|
|
|
|
jmp puts
|
|
|
|
|
g32: ;8======
|
|
|
|
|
inc al
|
|
|
|
|
cmp word[py],145
|
|
|
|
|
ja g33
|
|
|
|
|
;mov dword[idx],7 ;N=(0..8)
|
|
|
|
|
jmp puts
|
|
|
|
|
g33: ;9======
|
|
|
|
|
inc al
|
|
|
|
|
;mov dword[idx],8 ;N=(0..8)
|
|
|
|
|
|
|
|
|
|
puts: ;㦥 <EFBFBD><EFBFBD>।<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
push eax
|
|
|
|
|
pop dword[idx]
|
|
|
|
|
mov esi,dword[idx] ;
|
|
|
|
|
cmp byte[pox+esi],0 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>? (0-<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
|
|
|
|
jne event_wait ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>頥<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> 横<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
shl esi,2 ;*4
|
|
|
|
|
mov eax,dword[pole+esi]
|
|
|
|
|
mov dword[px],eax ;x coord from tabl ->px
|
|
|
|
|
;mov ax,word[pole+esi+2]
|
|
|
|
|
;mov word[py],ax ;y coord from tabl ->py
|
|
|
|
|
|
|
|
|
|
call x_put ;"X"
|
|
|
|
|
|
|
|
|
|
mov esi,dword[idx] ;esi - cell number =0..8
|
|
|
|
|
mov byte[pox+esi],'x'
|
|
|
|
|
inc byte[fill] ;turn+1
|
|
|
|
|
|
|
|
|
|
xor eax,eax ;eax=0
|
|
|
|
|
inc eax ;bit=1 eax=1
|
|
|
|
|
mov ecx,dword[idx] ; esi=n
|
|
|
|
|
shl ax,cl ; <<n-bit bit[n]=1
|
|
|
|
|
or word[poxl],ax ;set bit in [poxl]
|
|
|
|
|
|
|
|
|
|
call x_win ;<EFBFBD><EFBFBD>ઠ <EFBFBD>먣<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>
|
|
|
|
|
cmp byte[xwin],1 ;䫠<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>⠭<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?
|
|
|
|
|
jne del5 ;<EFBFBD><EFBFBD><EFBFBD> - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> delay
|
|
|
|
|
|
|
|
|
|
mov eax,4 ; <EFBFBD>㭪 4: <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ⥪<EFBFBD><EFBFBD> 'WINNER!'
|
|
|
|
|
mov ebx,18*65536+215 ; [x <EFBFBD><EFBFBD><EFBFBD>] *65536 + [y <EFBFBD><EFBFBD><EFBFBD>]
|
2012-06-04 10:11:24 +02:00
|
|
|
|
mov ecx, [colors+0x20] ; 梥<EFBFBD> ⥪<EFBFBD><EFBFBD><EFBFBD> RRGGBB
|
2011-01-29 23:35:52 +01:00
|
|
|
|
mov edx,texts ; 㪠<EFBFBD><EFBFBD>⥫<EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD>砫<EFBFBD> ⥪<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov esi,textend-texts ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ⥪<EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
int 0x40 ;
|
|
|
|
|
jmp event_wait ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>頥<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> 横<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
;===========================================================
|
|
|
|
|
del5: mov eax,5 ;=== delay 0,5 sec ===
|
|
|
|
|
mov ebx,50
|
|
|
|
|
int 0x40
|
|
|
|
|
|
|
|
|
|
cmp byte[fill],8 ;<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - 室<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>㤠
|
|
|
|
|
jnb event_wait ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>頥<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> 横<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
|
|
|
|
|
|
|
|
|
rnew: ;
|
|
|
|
|
call rndnext ; <EFBFBD><EFBFBD><EFBFBD>砩<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD> eax
|
|
|
|
|
and eax, 0111b ; eax = 0..7
|
|
|
|
|
mov esi,eax ; eax->esi
|
|
|
|
|
call rndnext ; <EFBFBD><EFBFBD><EFBFBD>砩<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD> eax
|
|
|
|
|
and eax, 01b ; eax= 0..1
|
|
|
|
|
add esi,eax ; esi+=eax
|
|
|
|
|
;esi=0..8 - index
|
|
|
|
|
cmp byte[pox+esi],0 ;<EFBFBD><EFBFBD><EFBFBD>砩<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?
|
|
|
|
|
jne rnew ;<EFBFBD><EFBFBD><EFBFBD> - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>砩<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
cmp byte[pox+4],0 ;業<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?
|
|
|
|
|
jne @F ;<EFBFBD><EFBFBD><EFBFBD> - <EFBFBD><EFBFBD><EFBFBD>砩<EFBFBD><EFBFBD><EFBFBD> 室 (㦥 <EFBFBD> esi)
|
|
|
|
|
mov esi,4 ;<EFBFBD><EFBFBD> - 室<EFBFBD><EFBFBD> <EFBFBD> 業<EFBFBD><EFBFBD> (4) <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
|
|
|
|
@@:
|
|
|
|
|
mov dword[idx],esi ;<EFBFBD><EFBFBD><EFBFBD>࠭<EFBFBD><EFBFBD> <EFBFBD> idx
|
|
|
|
|
;esi=0..8 - index
|
2012-06-04 10:11:24 +02:00
|
|
|
|
call o_com ;<EFBFBD><EFBFBD>ઠ 24<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>権 XX0
|
|
|
|
|
call x_com ;<EFBFBD><EFBFBD>ઠ 24<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>権 00*
|
2011-01-29 23:35:52 +01:00
|
|
|
|
|
|
|
|
|
mov esi,dword[idx] ;idx-<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>⪨(0..8) <EFBFBD>㤠 室
|
|
|
|
|
shl esi,2 ; esi*4 - <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>⮨<EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ᥩ <EFBFBD><EFBFBD> dword
|
|
|
|
|
mov eax,dword[pole+esi] ;
|
|
|
|
|
mov dword[px],eax ;x coord from tabl ->px
|
|
|
|
|
; mov ax,word[pole+esi+2] ;
|
|
|
|
|
; mov word[py],ax ;y coord from tabl ->py
|
|
|
|
|
call o_put ; <EFBFBD><EFBFBD><EFBFBD>㥬 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 'O'
|
|
|
|
|
|
|
|
|
|
mov esi,dword[idx]
|
|
|
|
|
mov byte[pox+esi],'o'
|
|
|
|
|
inc byte[fill] ;turn++
|
|
|
|
|
|
|
|
|
|
xor eax,eax ;eax=0
|
|
|
|
|
inc eax ;bit=1 eax=1
|
|
|
|
|
mov ecx,dword[idx] ; ecx=n
|
|
|
|
|
shl ax,cl ; <<n-bit bit[n]=1
|
|
|
|
|
or word[pool],ax ;set bit in [pool]
|
|
|
|
|
|
|
|
|
|
call o_win
|
|
|
|
|
cmp byte[owin],1
|
|
|
|
|
jne event_wait
|
|
|
|
|
|
|
|
|
|
mov eax,4 ; <EFBFBD>㭪 4: <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ⥪<EFBFBD><EFBFBD> 'LOOSER!'
|
|
|
|
|
mov ebx,48*65536+215 ; [x <EFBFBD><EFBFBD><EFBFBD>] *65536 + [y <EFBFBD><EFBFBD><EFBFBD>]
|
2012-06-04 10:11:24 +02:00
|
|
|
|
mov ecx, [colors+0x20] ; 梥<EFBFBD> ⥪<EFBFBD><EFBFBD><EFBFBD> RRGGBB
|
2011-01-29 23:35:52 +01:00
|
|
|
|
mov edx,lootxt ; 㪠<EFBFBD><EFBFBD>⥫<EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD>砫<EFBFBD> ⥪<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov esi,text-lootxt ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ⥪<EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
int 0x40 ;
|
|
|
|
|
jmp event_wait ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>頥<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> 横<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;===========================================--
|
|
|
|
|
;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|