2006-11-02 17:18:23 +03:00
|
|
|
;
|
2013-09-13 03:11:05 +04:00
|
|
|
; pipes kolibri
|
2016-02-21 00:36:29 +03:00
|
|
|
; v1.4
|
2006-11-02 17:18:23 +03:00
|
|
|
; 2006 by Mario Birkner
|
|
|
|
;
|
2016-02-21 00:36:29 +03:00
|
|
|
; l.mod. 20.02.16
|
2006-11-02 17:18:23 +03:00
|
|
|
;
|
|
|
|
; Compile with FASM
|
|
|
|
;
|
2014-03-26 16:43:14 +04:00
|
|
|
format binary as ""
|
|
|
|
|
2006-11-02 17:18:23 +03:00
|
|
|
bgcolor equ 0x0074744A ;thx
|
|
|
|
fgcolor equ 0x00E7C750 ;to
|
|
|
|
fg2color equ 0x00E0B0A0 ;colorref
|
|
|
|
fg3color equ 0x007F7F55
|
|
|
|
btcolor equ 0x005B6200
|
|
|
|
|
2007-05-10 17:48:35 +04:00
|
|
|
include '..\..\macros.inc'
|
2013-09-22 17:29:22 +04:00
|
|
|
include 'lang.inc'
|
2006-11-02 17:18:23 +03:00
|
|
|
|
2016-02-21 00:36:29 +03:00
|
|
|
use32
|
2006-11-02 17:18:23 +03:00
|
|
|
|
2016-02-21 00:36:29 +03:00
|
|
|
org 0x0
|
|
|
|
|
|
|
|
db 'MENUET01' ; 8 byte id
|
|
|
|
dd 0x01 ; header version
|
|
|
|
dd START ; start of code
|
|
|
|
dd I_END ; size of image
|
|
|
|
dd 0x100000 ; memory for app
|
|
|
|
dd 0x7fff0 ; esp
|
|
|
|
dd 0x0 , 0x0 ; I_Param , I_Icon
|
2006-11-02 17:18:23 +03:00
|
|
|
|
2014-03-26 16:43:14 +04:00
|
|
|
START: ; start of execution
|
2013-09-13 03:11:05 +04:00
|
|
|
jmp red
|
2006-11-02 17:18:23 +03:00
|
|
|
|
|
|
|
still:
|
2013-09-13 03:11:05 +04:00
|
|
|
mcall 10 ; wait here for event
|
2014-03-26 16:43:14 +04:00
|
|
|
cmp eax,1 ; redraw request ?
|
2006-11-02 17:18:23 +03:00
|
|
|
je red
|
2014-03-26 16:43:14 +04:00
|
|
|
cmp eax,2 ; key in buffer ?
|
2006-11-02 17:18:23 +03:00
|
|
|
je key
|
2014-03-26 16:43:14 +04:00
|
|
|
cmp eax,3 ; button in buffer ?
|
2006-11-02 17:18:23 +03:00
|
|
|
je button
|
|
|
|
jmp still
|
|
|
|
|
2014-03-26 16:43:14 +04:00
|
|
|
red: ; redraw
|
2006-11-02 17:18:23 +03:00
|
|
|
call draw_window
|
|
|
|
call draw_board
|
|
|
|
call draw_message
|
|
|
|
jmp still
|
|
|
|
|
2014-03-26 16:43:14 +04:00
|
|
|
key: ; key
|
|
|
|
mcall 2 ; just read it and ignore
|
2006-11-02 17:18:23 +03:00
|
|
|
jmp still
|
2014-03-26 16:43:14 +04:00
|
|
|
button: ; button
|
2006-11-02 17:18:23 +03:00
|
|
|
call get_input
|
|
|
|
jmp still
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
get_input:
|
|
|
|
pusha
|
2014-03-26 16:43:14 +04:00
|
|
|
mcall 17 ; get id
|
2006-11-02 17:18:23 +03:00
|
|
|
|
2014-03-26 16:43:14 +04:00
|
|
|
cmp ah,1 ; button id=1 ?
|
2006-11-02 17:18:23 +03:00
|
|
|
jne .noclose
|
2014-03-26 16:43:14 +04:00
|
|
|
mcall -1 ; close this program
|
2006-11-02 17:18:23 +03:00
|
|
|
.noclose:
|
|
|
|
cmp ah,4
|
|
|
|
jne .moderate
|
|
|
|
mov [diffic],1
|
|
|
|
jmp .enddiffic
|
|
|
|
.moderate:
|
|
|
|
cmp ah,3
|
|
|
|
jne .easy
|
|
|
|
mov [diffic],3
|
|
|
|
jmp .enddiffic
|
|
|
|
.easy:
|
|
|
|
cmp ah,2
|
|
|
|
jne .board
|
|
|
|
mov [diffic],5
|
|
|
|
.enddiffic:
|
|
|
|
mov [score],0
|
|
|
|
mov [speed],40
|
|
|
|
mov [level],1
|
|
|
|
mov [stat],0
|
|
|
|
mov [time],0
|
|
|
|
call draw_window
|
|
|
|
call scramble_board
|
|
|
|
call draw_board
|
|
|
|
call countdown
|
|
|
|
call wassermarsch
|
|
|
|
jmp .getno
|
|
|
|
.board:
|
|
|
|
cmp [stat],2
|
|
|
|
jge .getno
|
2014-03-26 16:43:14 +04:00
|
|
|
shr eax,8 ; -> 24bit id
|
2006-11-02 17:18:23 +03:00
|
|
|
cmp eax,10
|
|
|
|
jle .getno
|
|
|
|
cmp eax,150
|
2014-03-26 16:43:14 +04:00
|
|
|
jg .getno
|
2006-11-02 17:18:23 +03:00
|
|
|
sub eax,10
|
|
|
|
mov edi,eax
|
|
|
|
add edi,map
|
|
|
|
cmp [edi], byte 1
|
2014-03-26 16:43:14 +04:00
|
|
|
jg .nogerade
|
2006-11-02 17:18:23 +03:00
|
|
|
xor byte [edi], 1
|
|
|
|
call draw_board
|
|
|
|
jmp .getno
|
|
|
|
.nogerade:
|
|
|
|
cmp [edi], byte 6
|
|
|
|
jge .getno
|
|
|
|
cmp [edi], byte 5
|
|
|
|
jne .rota
|
|
|
|
sub byte [edi],4
|
|
|
|
.rota:
|
|
|
|
inc byte [edi]
|
|
|
|
call draw_board
|
|
|
|
.getno:
|
|
|
|
popa
|
|
|
|
ret
|
|
|
|
;//// end of event detection
|
2014-03-26 16:43:14 +04:00
|
|
|
get_direction: ;Setzt Richtungs-Konstanten
|
|
|
|
pusha ;IN:
|
|
|
|
mov eax,[esp+28] ;eax - Richtung IN
|
|
|
|
mov ebx,[esp+16] ;ebx - Teilchen (Map-Wert)
|
|
|
|
cmp ebx,0 ;OUT:
|
|
|
|
jne .no0 ;eax - Richtung OUT
|
2006-11-02 17:18:23 +03:00
|
|
|
cmp eax,14
|
|
|
|
jne .o0
|
|
|
|
jmp .setout
|
|
|
|
.o0:
|
|
|
|
cmp eax,-14
|
|
|
|
jne .col
|
|
|
|
jmp .setout
|
|
|
|
.no0:
|
|
|
|
cmp ebx,1
|
|
|
|
jne .no1
|
|
|
|
cmp eax,1
|
|
|
|
jne .o1
|
|
|
|
jmp .setout
|
|
|
|
.o1:
|
|
|
|
cmp eax,-1
|
|
|
|
jne .col
|
|
|
|
jmp .setout
|
|
|
|
.no1:
|
|
|
|
cmp ebx,2
|
|
|
|
jne .no2
|
|
|
|
cmp eax,14
|
|
|
|
jne .o2
|
|
|
|
sub eax,13
|
|
|
|
jmp .setout
|
|
|
|
.o2:
|
|
|
|
cmp eax,-1
|
|
|
|
jne .col
|
|
|
|
sub eax,13
|
|
|
|
jmp .setout
|
|
|
|
.no2:
|
|
|
|
cmp ebx,3
|
|
|
|
jne .no3
|
|
|
|
cmp eax,-14
|
|
|
|
jne .o3
|
|
|
|
add eax,15
|
|
|
|
jmp .setout
|
|
|
|
.o3:
|
|
|
|
cmp eax,-1
|
|
|
|
jne .col
|
|
|
|
add eax,15
|
|
|
|
jmp .setout
|
|
|
|
.no3:
|
|
|
|
cmp ebx,4
|
|
|
|
jne .no4
|
|
|
|
cmp eax,-14
|
|
|
|
jne .o4
|
|
|
|
add eax,13
|
|
|
|
jmp .setout
|
|
|
|
.o4:
|
|
|
|
cmp eax,1
|
|
|
|
jne .col
|
|
|
|
add eax,13
|
|
|
|
jmp .setout
|
|
|
|
.no4:
|
|
|
|
cmp ebx,5
|
|
|
|
jne .no5
|
|
|
|
cmp eax,14
|
|
|
|
jne .o5
|
|
|
|
sub eax,15
|
|
|
|
jmp .setout
|
|
|
|
.o5:
|
|
|
|
cmp eax,1
|
|
|
|
jne .col
|
|
|
|
sub eax,15
|
|
|
|
jmp .setout
|
|
|
|
.no5:
|
|
|
|
cmp ebx,6
|
|
|
|
jne .no6
|
|
|
|
jmp .setout
|
|
|
|
.no6:
|
|
|
|
cmp ebx,7
|
|
|
|
jne .no7
|
|
|
|
mov eax,14
|
|
|
|
jmp .setout
|
|
|
|
.no7:
|
|
|
|
cmp ebx,8
|
|
|
|
jne .no8
|
|
|
|
cmp eax,14
|
|
|
|
jne .col
|
|
|
|
mov [stat],1
|
|
|
|
jmp .setout
|
|
|
|
.no8:
|
2014-03-26 16:43:14 +04:00
|
|
|
cmp ebx,16 ; cross 2x
|
2006-11-02 17:18:23 +03:00
|
|
|
jne .col
|
|
|
|
add [score],10 ; + 10 bonus points
|
|
|
|
jmp .setout
|
|
|
|
.col:
|
|
|
|
xor eax,eax
|
|
|
|
.setout:
|
|
|
|
xor ebx,ebx
|
|
|
|
mov [esp+28],eax
|
|
|
|
mov [esp+16],ebx
|
|
|
|
popa
|
|
|
|
ret
|
|
|
|
|
|
|
|
countdown:
|
|
|
|
pusha
|
|
|
|
xor eax,eax
|
|
|
|
mov al,[diffic]
|
|
|
|
imul eax,10
|
|
|
|
mov [time],eax
|
|
|
|
.udown:
|
|
|
|
call show_score
|
|
|
|
mov ecx,10
|
|
|
|
.down:
|
|
|
|
mov eax,5
|
|
|
|
mov ebx,10
|
2007-05-10 17:48:35 +04:00
|
|
|
mcall
|
2006-11-02 17:18:23 +03:00
|
|
|
mov eax,11
|
2007-05-10 17:48:35 +04:00
|
|
|
mcall
|
2006-11-02 17:18:23 +03:00
|
|
|
cmp eax,1
|
|
|
|
jne .nored
|
|
|
|
call draw_window
|
|
|
|
call draw_board
|
|
|
|
jmp .nothing
|
|
|
|
.nored:
|
|
|
|
cmp eax,3
|
|
|
|
jne .nothing
|
|
|
|
call get_input
|
|
|
|
.nothing:
|
2014-03-26 16:43:14 +04:00
|
|
|
cmp [stat],0 ;bugfix 210806
|
|
|
|
jnz .exitsub ;bugfix 210806
|
2006-11-02 17:18:23 +03:00
|
|
|
dec ecx
|
|
|
|
jnz .down
|
|
|
|
dec [time]
|
|
|
|
jnz .udown
|
2014-03-26 16:43:14 +04:00
|
|
|
.exitsub: ;bugfix 210806
|
2006-11-02 17:18:23 +03:00
|
|
|
popa
|
|
|
|
ret
|
|
|
|
|
|
|
|
wassermarsch:
|
|
|
|
pusha
|
|
|
|
.restart:
|
2014-03-26 16:43:14 +04:00
|
|
|
mov esi,map+16 ;start position
|
|
|
|
mov eax, 14 ;start-richtung
|
2006-11-02 17:18:23 +03:00
|
|
|
.findway:
|
|
|
|
movzx ebx, byte [esi]
|
|
|
|
call get_direction
|
|
|
|
test eax,eax
|
|
|
|
jz .collision
|
|
|
|
push eax
|
|
|
|
xor eax,eax
|
|
|
|
mov al,6
|
|
|
|
sub al,[diffic]
|
2014-03-26 16:43:14 +04:00
|
|
|
add [score],eax ;points/item = 6 - difficulty
|
2006-11-02 17:18:23 +03:00
|
|
|
mov ecx,dword [speed]
|
|
|
|
add byte [esi],10
|
|
|
|
.down:
|
|
|
|
mov eax,5
|
|
|
|
mov ebx,2
|
2007-05-10 17:48:35 +04:00
|
|
|
mcall
|
2006-11-02 17:18:23 +03:00
|
|
|
mov eax,11
|
2007-05-10 17:48:35 +04:00
|
|
|
mcall
|
2006-11-02 17:18:23 +03:00
|
|
|
cmp eax,1
|
|
|
|
jne .nored
|
|
|
|
call draw_window
|
|
|
|
.nored:
|
|
|
|
cmp eax,3
|
|
|
|
jne .noevnt
|
|
|
|
call get_input
|
|
|
|
.noevnt:
|
|
|
|
dec ecx
|
|
|
|
jnz .down
|
|
|
|
pop eax
|
|
|
|
|
|
|
|
add esi,eax
|
|
|
|
call draw_board
|
|
|
|
call show_score
|
|
|
|
jmp .findway
|
|
|
|
.collision:
|
|
|
|
cmp [stat],1
|
|
|
|
jne .loose
|
|
|
|
call draw_message
|
|
|
|
mov eax,5
|
|
|
|
mov ebx,500
|
2007-05-10 17:48:35 +04:00
|
|
|
mcall
|
2006-11-02 17:18:23 +03:00
|
|
|
mov [stat],0
|
|
|
|
inc [level]
|
2014-03-26 16:43:14 +04:00
|
|
|
cmp [speed],6 ;waterflowdelay < 6 ?
|
2006-11-02 17:18:23 +03:00
|
|
|
jle .skipsub
|
|
|
|
sub [speed],2
|
|
|
|
.skipsub:
|
|
|
|
call draw_window
|
|
|
|
call scramble_board
|
|
|
|
call draw_board
|
|
|
|
call countdown
|
|
|
|
jmp .restart
|
|
|
|
.loose:
|
|
|
|
mov [stat],2
|
|
|
|
call draw_message
|
|
|
|
popa
|
|
|
|
ret
|
|
|
|
|
|
|
|
show_score:
|
|
|
|
pusha
|
|
|
|
mov eax,47
|
|
|
|
mov ebx,0x20000
|
|
|
|
mov ecx,[time]
|
2016-02-21 00:36:29 +03:00
|
|
|
mov edx,60*65536+395
|
2006-11-02 17:18:23 +03:00
|
|
|
mov esi,fg2color
|
2016-02-21 00:36:29 +03:00
|
|
|
mov edi,bgcolor
|
|
|
|
or esi,0x50000000
|
2007-05-10 17:48:35 +04:00
|
|
|
mcall
|
2006-11-02 17:18:23 +03:00
|
|
|
mov ebx,0x50000
|
|
|
|
mov ecx,[score]
|
2013-09-22 17:29:22 +04:00
|
|
|
if lang eq et
|
2016-02-21 00:36:29 +03:00
|
|
|
add edx,88 shl 16
|
2013-09-22 17:29:22 +04:00
|
|
|
else
|
2016-02-21 00:36:29 +03:00
|
|
|
add edx,80 shl 16
|
2013-09-22 17:29:22 +04:00
|
|
|
end if
|
2007-05-10 17:48:35 +04:00
|
|
|
mcall
|
2006-11-02 17:18:23 +03:00
|
|
|
mov ebx,0x20000
|
|
|
|
mov ecx,[level]
|
2016-02-21 00:36:29 +03:00
|
|
|
add edx,104 shl 16
|
2007-05-10 17:48:35 +04:00
|
|
|
mcall
|
2006-11-02 17:18:23 +03:00
|
|
|
|
|
|
|
popa
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
scramble_board:
|
|
|
|
pusha
|
|
|
|
mov edi,map+16 ;startpunkt
|
|
|
|
mov eax,7 ;wieder-
|
2014-03-26 16:43:14 +04:00
|
|
|
stosb ;herstellen
|
2006-11-02 17:18:23 +03:00
|
|
|
|
|
|
|
mov ebx, 0x00000007 ;modul m max-wert
|
|
|
|
.loop_through:
|
|
|
|
mov esi,edi
|
|
|
|
lodsb
|
|
|
|
cmp eax, 9
|
|
|
|
je .skip
|
|
|
|
inc eax
|
|
|
|
xor edx, edx
|
2014-03-26 16:43:14 +04:00
|
|
|
div ebx ;modulo -> edx
|
2006-11-02 17:18:23 +03:00
|
|
|
mov eax, edx
|
|
|
|
cmp eax,6
|
|
|
|
jne .skip
|
|
|
|
dec [half]
|
|
|
|
movzx eax, byte [half]
|
|
|
|
jnz .skip
|
|
|
|
mov [half], byte 7
|
|
|
|
.skip:
|
|
|
|
stosb
|
|
|
|
cmp edi,map+125 ;endpunkt erhalten
|
|
|
|
jge .exit
|
|
|
|
jmp .loop_through
|
|
|
|
.exit:
|
|
|
|
mov eax,8
|
|
|
|
stosb
|
|
|
|
popa
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
gen_image:
|
|
|
|
pusha
|
2014-03-26 16:43:14 +04:00
|
|
|
xor ebx,ebx ;default: kein wasser
|
2006-11-02 17:18:23 +03:00
|
|
|
movzx eax,byte [map] ;erstes byte der map lesen (position)
|
2014-03-26 16:43:14 +04:00
|
|
|
inc byte [map] ;position inkrementieren
|
|
|
|
add eax,map ;zur position die map-adresse addieren
|
2006-11-02 17:18:23 +03:00
|
|
|
movzx esi,byte [eax]
|
|
|
|
cmp esi,10
|
2014-03-26 16:43:14 +04:00
|
|
|
jl .nowater
|
|
|
|
sub esi,10 ;map-werte+10 sind mit wasser gefuellt
|
2006-11-02 17:18:23 +03:00
|
|
|
mov ebx,1
|
|
|
|
cmp esi,16
|
|
|
|
jne .nowater
|
|
|
|
sub esi,10
|
|
|
|
.nowater:
|
2014-03-26 16:43:14 +04:00
|
|
|
imul esi,3072 ;mapwert * 32*32*3 = image-adresse
|
2006-11-02 17:18:23 +03:00
|
|
|
add esi,images
|
|
|
|
mov edi,0x10000
|
|
|
|
mov ecx,32*32*3
|
2014-03-26 16:43:14 +04:00
|
|
|
.gendd: ;RGB-Image im Speicher generieren
|
2006-11-02 17:18:23 +03:00
|
|
|
mov eax,dword [esi] ;byte aus imagemap lesen
|
|
|
|
shl eax,8
|
|
|
|
shr eax,8
|
|
|
|
cmp ebx,0
|
2014-03-26 16:43:14 +04:00
|
|
|
jz .nowcolor
|
2006-11-02 17:18:23 +03:00
|
|
|
mov ebx,eax
|
|
|
|
cmp ebx,0x00B0B5B0
|
|
|
|
jne .nog1
|
|
|
|
jmp .wcolor
|
|
|
|
.nog1:
|
|
|
|
cmp ebx,0x00A0A5A0
|
|
|
|
jne .nog2
|
|
|
|
jmp .wcolor
|
|
|
|
.nog2:
|
|
|
|
cmp ebx,0x00909590
|
|
|
|
jne .nog3
|
|
|
|
jmp .wcolor
|
|
|
|
.nog3:
|
|
|
|
cmp ebx,0x00808580
|
|
|
|
jne .nog4
|
|
|
|
jmp .wcolor
|
|
|
|
.nog4:
|
|
|
|
cmp ebx,0x00707570
|
|
|
|
jne .nowcolor
|
|
|
|
jmp .wcolor
|
|
|
|
.wcolor:
|
|
|
|
add eax,0x40
|
|
|
|
.nowcolor:
|
|
|
|
add esi,3
|
|
|
|
stosd
|
|
|
|
dec edi
|
|
|
|
loop .gendd
|
|
|
|
popa
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; *********************************************
|
|
|
|
; ******* WINDOW DEFINITIONS AND DRAW ********
|
|
|
|
; *********************************************
|
|
|
|
draw_message:
|
|
|
|
pusha
|
|
|
|
cmp [stat],0
|
2014-03-26 16:43:14 +04:00
|
|
|
je .nomessage
|
2016-02-21 00:36:29 +03:00
|
|
|
mcall 13,<146,200>,<190,40>,0
|
2006-11-02 17:18:23 +03:00
|
|
|
add ebx,2 shl 16 - 4
|
|
|
|
add ecx,2 shl 16 - 4
|
|
|
|
mov edx,fgcolor
|
2007-05-10 17:48:35 +04:00
|
|
|
mcall
|
2006-11-02 17:18:23 +03:00
|
|
|
|
2014-03-26 16:43:14 +04:00
|
|
|
cmp [stat],3
|
|
|
|
jne .stat1
|
2013-09-13 03:11:05 +04:00
|
|
|
mov eax,4
|
2016-02-21 00:36:29 +03:00
|
|
|
mov ebx,159 shl 16 +202
|
|
|
|
mov edx,lbl_new_game
|
2013-09-13 03:11:05 +04:00
|
|
|
mov ecx,btcolor
|
2016-02-21 00:36:29 +03:00
|
|
|
or ecx,0xB0000000
|
2013-09-13 03:11:05 +04:00
|
|
|
mcall
|
2014-03-26 16:43:14 +04:00
|
|
|
jmp .nomessage
|
2013-09-13 03:11:05 +04:00
|
|
|
|
2014-03-26 16:43:14 +04:00
|
|
|
.stat1:
|
2006-11-02 17:18:23 +03:00
|
|
|
cmp [stat],1
|
|
|
|
je .winmessage
|
|
|
|
mov eax,4
|
2016-02-21 00:36:29 +03:00
|
|
|
mov ebx,170 shl 16 +196
|
|
|
|
mov edx,lbl_gameover
|
2006-11-02 17:18:23 +03:00
|
|
|
mov ecx,btcolor
|
2016-02-21 00:36:29 +03:00
|
|
|
or ecx,0xB0000000
|
2007-05-10 17:48:35 +04:00
|
|
|
mcall
|
2006-11-02 17:18:23 +03:00
|
|
|
add ebx,8 shl 16 +17
|
2016-02-21 00:36:29 +03:00
|
|
|
mov edx,lbl_yscore
|
2006-11-02 17:18:23 +03:00
|
|
|
mov ecx,btcolor
|
2007-05-10 17:48:35 +04:00
|
|
|
mcall
|
2014-03-26 16:43:14 +04:00
|
|
|
mov esi,ecx ;color
|
|
|
|
mov edx,ebx ;pos
|
2006-11-02 17:18:23 +03:00
|
|
|
add edx,80 shl 16
|
2014-03-26 16:43:14 +04:00
|
|
|
mov ebx,0x50000 ;type
|
|
|
|
mov ecx,[score] ;inp
|
2006-11-02 17:18:23 +03:00
|
|
|
mov eax,47
|
2007-05-10 17:48:35 +04:00
|
|
|
mcall
|
2006-11-02 17:18:23 +03:00
|
|
|
jmp .nomessage
|
|
|
|
.winmessage:
|
|
|
|
mov eax,4
|
|
|
|
mov ebx,152 shl 16 +200
|
2016-02-21 00:36:29 +03:00
|
|
|
mov edx,lbl_win
|
2006-11-02 17:18:23 +03:00
|
|
|
mov ecx,btcolor
|
2016-02-21 00:36:29 +03:00
|
|
|
or ecx,0xB0000000
|
2007-05-10 17:48:35 +04:00
|
|
|
mcall
|
2006-11-02 17:18:23 +03:00
|
|
|
mov ebx,152 shl 16 +217
|
|
|
|
add edx,esi
|
|
|
|
mov ecx,btcolor
|
2007-05-10 17:48:35 +04:00
|
|
|
mcall
|
2006-11-02 17:18:23 +03:00
|
|
|
.nomessage:
|
|
|
|
popa
|
|
|
|
ret
|
|
|
|
|
|
|
|
draw_board:
|
|
|
|
pusha
|
|
|
|
mov ebx,15*65536+32
|
|
|
|
mov ecx,50*65536+32
|
2014-03-26 16:43:14 +04:00
|
|
|
mov edx,15*65536+50 ;Spielfeldposition
|
2016-02-21 00:36:29 +03:00
|
|
|
mov esi,10 ;Spielfeldgroesse Y
|
2006-11-02 17:18:23 +03:00
|
|
|
.vloop:
|
2014-03-26 16:43:14 +04:00
|
|
|
mov edi,14 ;Spielfeldgroesse X
|
2006-11-02 17:18:23 +03:00
|
|
|
.hloop:
|
|
|
|
call gen_image
|
|
|
|
push edx
|
|
|
|
mov eax,8
|
|
|
|
movsx edx, byte [map]
|
2014-03-26 16:43:14 +04:00
|
|
|
add edx,9 ;button-id = map-pos + 10;gen_image inkrements
|
2012-03-30 11:03:25 +04:00
|
|
|
add edx,0x80000000 ;first delete previous button
|
2016-02-21 00:36:29 +03:00
|
|
|
mcall
|
2013-09-13 03:11:05 +04:00
|
|
|
sub edx,0x30000000 ;first delete previous button
|
2007-05-10 17:48:35 +04:00
|
|
|
mcall
|
2006-11-02 17:18:23 +03:00
|
|
|
pop edx
|
|
|
|
push ebx
|
|
|
|
push ecx
|
|
|
|
mov eax,7
|
|
|
|
mov ebx,0x10000
|
|
|
|
mov ecx,32 shl 16 +32
|
2007-05-10 17:48:35 +04:00
|
|
|
mcall
|
2006-11-02 17:18:23 +03:00
|
|
|
pop ecx
|
|
|
|
pop ebx
|
|
|
|
add edx,33 shl 16
|
|
|
|
add ebx,33 shl 16
|
|
|
|
dec edi
|
|
|
|
jnz .hloop
|
2014-03-26 16:43:14 +04:00
|
|
|
sub edx,14*(33 shl 16) ;Spielfeldgroesse X
|
2006-11-02 17:18:23 +03:00
|
|
|
sub ebx,14*(33 shl 16)
|
|
|
|
add edx,33
|
|
|
|
add ecx,33 shl 16
|
|
|
|
dec esi
|
|
|
|
jnz .vloop
|
2014-03-26 16:43:14 +04:00
|
|
|
mov [map], byte 1 ;Map-Position zuruecksetzen
|
2006-11-02 17:18:23 +03:00
|
|
|
popa
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
draw_window:
|
|
|
|
pusha
|
|
|
|
|
2013-09-13 03:11:05 +04:00
|
|
|
mcall 12,1
|
2016-02-21 00:36:29 +03:00
|
|
|
|
|
|
|
mov edx,bgcolor
|
2007-06-23 00:24:06 +04:00
|
|
|
or edx,0x14000000
|
2016-02-21 00:36:29 +03:00
|
|
|
mcall 0,<100,492>,<100,422>,,,lbl_title
|
2006-11-02 17:18:23 +03:00
|
|
|
|
2016-02-21 00:36:29 +03:00
|
|
|
mcall 8,<100,72>,<28,16>,2,btcolor
|
|
|
|
add ebx,80 shl 16
|
2006-11-02 17:18:23 +03:00
|
|
|
inc edx
|
2007-05-10 17:48:35 +04:00
|
|
|
mcall
|
2016-02-21 00:36:29 +03:00
|
|
|
add ebx,80 shl 16
|
2006-11-02 17:18:23 +03:00
|
|
|
inc edx
|
2007-05-10 17:48:35 +04:00
|
|
|
mcall
|
2006-11-02 17:18:23 +03:00
|
|
|
|
|
|
|
mov eax,4
|
2016-02-21 00:36:29 +03:00
|
|
|
mov ebx,20 shl 16 +29
|
2006-11-02 17:18:23 +03:00
|
|
|
mov ecx,fgcolor
|
2016-02-21 00:36:29 +03:00
|
|
|
or ecx,0xB0000000
|
|
|
|
mov edx,lbl_toolbar
|
2007-05-10 17:48:35 +04:00
|
|
|
mcall
|
2016-02-21 00:36:29 +03:00
|
|
|
or ecx,0x00000000
|
|
|
|
mov ebx,18 shl 16 +395
|
|
|
|
mov edx,lbl_score
|
2007-05-10 17:48:35 +04:00
|
|
|
mcall
|
2013-09-13 03:11:05 +04:00
|
|
|
mov ebx,340 shl 16 +405
|
2006-11-02 17:18:23 +03:00
|
|
|
mov ecx,fg3color
|
2016-02-21 00:36:29 +03:00
|
|
|
mov edx,lbl_copy
|
2007-05-10 17:48:35 +04:00
|
|
|
mcall
|
2006-11-02 17:18:23 +03:00
|
|
|
|
2013-09-13 03:11:05 +04:00
|
|
|
mcall 12,2
|
2006-11-02 17:18:23 +03:00
|
|
|
|
|
|
|
popa
|
|
|
|
ret
|
|
|
|
|
2016-02-21 00:36:29 +03:00
|
|
|
;=================================================
|
|
|
|
; DATA - LABELS
|
|
|
|
;=================================================
|
2013-09-22 17:29:22 +04:00
|
|
|
if lang eq et
|
2016-02-21 00:36:29 +03:00
|
|
|
lbl_title db 'Torud',0
|
|
|
|
lbl_gameover db 'M ä n g L ä b i !',0
|
|
|
|
lbl_new_game db 'Alusta enne uut mängu',0
|
|
|
|
lbl_win: db ' T u b l i ! '
|
|
|
|
db ' Lähme edasi! ',0
|
|
|
|
lbl_yscore db 'Sinu tulemus:',0
|
|
|
|
lbl_toolbar db 'Uus mäng: Lihtne Keskmine Raske',0
|
|
|
|
lbl_copy db 'v1.21 2006,Mario Birkner',0
|
|
|
|
lbl_score db ' Aeg: Tulemus: Tase:',0
|
2013-09-22 17:29:22 +04:00
|
|
|
else
|
2016-02-21 00:36:29 +03:00
|
|
|
lbl_title db 'Pipes',0
|
|
|
|
lbl_gameover db 'G a m e O v e r !',0
|
|
|
|
lbl_new_game db 'Start a new game first',0
|
|
|
|
lbl_win: db ' G r e a t ! '
|
|
|
|
db " Let's keep going! ",0
|
|
|
|
lbl_yscore db 'Your Score:',0
|
|
|
|
lbl_toolbar db 'New Game: Easy Normal Hard',0
|
|
|
|
lbl_copy db 'v1.21 2006,Mario Birkner',0
|
|
|
|
lbl_score db 'Time: Score: Level:',0
|
2013-09-22 17:29:22 +04:00
|
|
|
end if
|
2016-02-21 00:36:29 +03:00
|
|
|
|
|
|
|
;=================================================
|
|
|
|
; DATA - VARS
|
|
|
|
;=================================================
|
2014-03-26 16:43:14 +04:00
|
|
|
stat db 3 ;0=gameplay 1=won 2-lost 3=stopped
|
|
|
|
speed db 0
|
|
|
|
time dd 0
|
|
|
|
diffic db 0 ;1=hard 3=moderate 5=easy 8=dedicated to Wildwest - try it out!
|
|
|
|
score dd 0
|
|
|
|
level dd 1
|
|
|
|
half db 1 ;reduces the random-crosses
|
|
|
|
|
2016-02-21 00:36:29 +03:00
|
|
|
;=================================================
|
|
|
|
; DATA - RES
|
|
|
|
;=================================================
|
2014-03-26 16:43:14 +04:00
|
|
|
map: ;14*10 blocks + position
|
2006-11-02 17:18:23 +03:00
|
|
|
db 1 ;<- act. position
|
|
|
|
db 9,9,9,9,9,9,9,9,9,9,9,9,9,9
|
|
|
|
db 9,7,1,3,2,0,1,1,0,3,4,4,3,9
|
|
|
|
db 9,5,0,2,2,1,3,0,3,1,1,6,4,9
|
|
|
|
db 9,4,0,4,6,0,3,3,2,6,0,1,2,9
|
|
|
|
db 9,3,0,1,2,4,6,4,5,1,2,4,1,9
|
|
|
|
db 9,5,3,2,6,3,2,1,2,1,2,6,0,9
|
|
|
|
db 9,4,0,2,3,0,4,1,2,3,2,3,4,9
|
|
|
|
db 9,2,0,4,5,6,3,1,3,0,4,1,0,9
|
|
|
|
db 9,1,0,3,5,4,2,2,4,1,6,0,8,9
|
|
|
|
db 9,9,9,9,9,9,9,9,9,9,9,9,9,9
|
|
|
|
images:
|
|
|
|
file 'pipes.raw'
|
|
|
|
I_END:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|