forked from KolibriOS/kolibrios
Use sysfn 70 instead of 58 to load files, added proper window caption.
git-svn-id: svn://kolibrios.org@6184 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
91a77b6278
commit
5b72cf08cc
@ -27,6 +27,8 @@
|
|||||||
|
|
||||||
; COMPILE WITH FASM
|
; COMPILE WITH FASM
|
||||||
|
|
||||||
|
format binary as ""
|
||||||
|
|
||||||
include '../../../macros.inc' ; decrease code size (optional)
|
include '../../../macros.inc' ; decrease code size (optional)
|
||||||
include 'CELLTYPE.INC' ; object identifiers
|
include 'CELLTYPE.INC' ; object identifiers
|
||||||
;include 'debug.inc'
|
;include 'debug.inc'
|
||||||
@ -35,41 +37,41 @@ include 'lang.inc'
|
|||||||
|
|
||||||
CUR_DIR equ '/sys/games/' ; change it to appropriate path
|
CUR_DIR equ '/sys/games/' ; change it to appropriate path
|
||||||
|
|
||||||
SKIN_SIZE equ 11520 ; size of skin file (16x240)
|
SKIN_SIZE = 11520 ; size of skin file (16x240)
|
||||||
|
|
||||||
; field dimensions
|
; field dimensions
|
||||||
FLD_LEFT equ 43
|
FLD_LEFT = 43
|
||||||
FLD_LEFT2 equ FLD_LEFT shl 16
|
FLD_LEFT2 = FLD_LEFT shl 16
|
||||||
FLD_TOP equ 40
|
FLD_TOP = 40
|
||||||
FLD_TOP2 equ FLD_TOP shl 16
|
FLD_TOP2 = FLD_TOP shl 16
|
||||||
IMG_SIZE equ 16 shl 16+16
|
IMG_SIZE = 16 shl 16+16
|
||||||
SHIFT equ (16 shl 16)
|
SHIFT = (16 shl 16)
|
||||||
WND_COLOR equ 0x03aabbcc
|
WND_COLOR = 0x00aabbcc
|
||||||
|
|
||||||
; level list dimensions
|
; level list dimensions
|
||||||
LEVLIST_XY equ FLD_TOP shl 16+45
|
LEVLIST_XY = FLD_TOP shl 16+45
|
||||||
LEVLIST_SPACING equ 10
|
LEVLIST_SPACING = 10
|
||||||
LEVWND_X equ 320
|
LEVWND_X = 320
|
||||||
LEVWND_Y equ 200
|
LEVWND_Y = 200
|
||||||
|
|
||||||
; input line dimensions
|
; input line dimensions
|
||||||
INP_X equ 10 shl 16+300
|
INP_X = 10 shl 16+300
|
||||||
INP_Y equ 160 shl 16+16
|
INP_Y = 160 shl 16+16
|
||||||
INP_XY equ 15 shl 16+164
|
INP_XY = 15 shl 16+164
|
||||||
|
|
||||||
; load button dimensions
|
; load button dimensions
|
||||||
LOAD_X equ 130 shl 16+65
|
LOAD_X = 130 shl 16+65
|
||||||
LOAD_Y equ 180 shl 16+14
|
LOAD_Y = 180 shl 16+14
|
||||||
LOAD_XY equ 135 shl 16+184
|
LOAD_XY = 135 shl 16+184
|
||||||
CHOOSE_XY equ 40 shl 16+148
|
CHOOSE_XY = 40 shl 16+148
|
||||||
|
|
||||||
|
|
||||||
WIN_XY equ 135 shl 16+25
|
WIN_XY = 135 shl 16+25
|
||||||
|
|
||||||
; workmode constants, more defs in CELLTYPE.INC
|
; workmode constants, more defs in CELLTYPE.INC
|
||||||
WM_WINNER equ 0x10
|
WM_WINNER = 0x10
|
||||||
WM_READSET equ 0
|
WM_READSET = 0
|
||||||
WM_LOSE equ 0x20
|
WM_LOSE = 0x20
|
||||||
|
|
||||||
use32
|
use32
|
||||||
org 0x0
|
org 0x0
|
||||||
@ -83,7 +85,7 @@ use32
|
|||||||
dd 0x0
|
dd 0x0
|
||||||
|
|
||||||
START:
|
START:
|
||||||
mov eax,58 ; load skin image-it is in RAW 16x240 BGR
|
mov eax,70 ; load skin image-it is in RAW 16x240 BGR
|
||||||
mov ebx,file_info ; IrfanView recommended
|
mov ebx,file_info ; IrfanView recommended
|
||||||
int 0x40
|
int 0x40
|
||||||
test ebx,ebx
|
test ebx,ebx
|
||||||
@ -103,7 +105,7 @@ START:
|
|||||||
mov [levpage],eax
|
mov [levpage],eax
|
||||||
mov word[ll_num],'00' ; reset some counters
|
mov word[ll_num],'00' ; reset some counters
|
||||||
read_cnf:
|
read_cnf:
|
||||||
mov eax,58
|
mov eax,70
|
||||||
mov ebx,file_info
|
mov ebx,file_info
|
||||||
int 0x40
|
int 0x40
|
||||||
test ebx,ebx ; load standard levels SOKO-?.LEV instead of custom
|
test ebx,ebx ; load standard levels SOKO-?.LEV instead of custom
|
||||||
@ -216,7 +218,7 @@ still:
|
|||||||
call valid_move
|
call valid_move
|
||||||
cmp byte[winmode],WM_WINNER
|
cmp byte[winmode],WM_WINNER
|
||||||
jne no_winner
|
jne no_winner
|
||||||
mov ecx,0x20ac0000
|
mov ecx,0x00ac0000
|
||||||
mov edx,win_msg
|
mov edx,win_msg
|
||||||
mov esi,win_msg_end-win_msg ; print victory congratulations
|
mov esi,win_msg_end-win_msg ; print victory congratulations
|
||||||
print_msg:
|
print_msg:
|
||||||
@ -344,16 +346,9 @@ draw_window:
|
|||||||
add ebx,[wnd_width]
|
add ebx,[wnd_width]
|
||||||
mov ecx,50*65536
|
mov ecx,50*65536
|
||||||
add ecx,[wnd_height]
|
add ecx,[wnd_height]
|
||||||
mov edx,WND_COLOR
|
mov edx,0x13000000 + WND_COLOR
|
||||||
mov esi,0x805080d0
|
mov esi,0x005080d0
|
||||||
mov edi,0x005080d0
|
mov edi,zagolovok
|
||||||
int 0x40
|
|
||||||
|
|
||||||
mov eax,4
|
|
||||||
mov ebx,8*65536+8
|
|
||||||
mov ecx,0x10ddeeff
|
|
||||||
mov edx,zagolovok
|
|
||||||
mov esi,zag_konets-zagolovok
|
|
||||||
int 0x40
|
int 0x40
|
||||||
|
|
||||||
cmp byte[workmode],WM_READSET
|
cmp byte[workmode],WM_READSET
|
||||||
@ -385,14 +380,14 @@ draw_window:
|
|||||||
int 0x40
|
int 0x40
|
||||||
|
|
||||||
mov eax,4
|
mov eax,4
|
||||||
mov ecx,0x20107a30
|
mov ecx,0x00107a30
|
||||||
mov ebx,LOAD_XY
|
mov ebx,LOAD_XY
|
||||||
mov edx,load_char
|
mov edx,load_char
|
||||||
mov esi,loadlen-load_char
|
mov esi,loadlen-load_char
|
||||||
int 0x40
|
int 0x40
|
||||||
|
|
||||||
mov ebx,LEVLIST_XY
|
mov ebx,LEVLIST_XY
|
||||||
mov edi,0x204e00e7
|
mov edi,0x004e00e7
|
||||||
xor esi,esi
|
xor esi,esi
|
||||||
mov ecx,10
|
mov ecx,10
|
||||||
ll_cycle:
|
ll_cycle:
|
||||||
@ -843,7 +838,7 @@ check_lasers:
|
|||||||
je no_cl_destroy
|
je no_cl_destroy
|
||||||
cmp al,tPlayer
|
cmp al,tPlayer
|
||||||
jne cl_exit
|
jne cl_exit
|
||||||
mov ecx,0x20ac0000
|
mov ecx,0x00ac0000
|
||||||
mov edx,lose_msg
|
mov edx,lose_msg
|
||||||
mov esi,lose_msg_end-lose_msg ; print loose message
|
mov esi,lose_msg_end-lose_msg ; print loose message
|
||||||
mov byte[winmode],WM_LOSE
|
mov byte[winmode],WM_LOSE
|
||||||
@ -1092,14 +1087,9 @@ else
|
|||||||
end if
|
end if
|
||||||
lose_msg_end:
|
lose_msg_end:
|
||||||
|
|
||||||
zagolovok: ; áâப § £®«®¢ª
|
zagolovok:
|
||||||
if lang eq ru
|
db 'Sokoban', 0
|
||||||
db '‘ŽŠŽ<C5A0>€<EFBFBD> „‹Ÿ'
|
|
||||||
else
|
|
||||||
db 'SOKOBAN FOR'
|
|
||||||
end if
|
|
||||||
db ' MENUET'
|
|
||||||
zag_konets: ; ¨ ¥ñ ª®¥æ
|
|
||||||
|
|
||||||
pic_map:
|
pic_map:
|
||||||
db 0xf,9,0,0,1,1,5,6
|
db 0xf,9,0,0,1,1,5,6
|
||||||
@ -1123,12 +1113,11 @@ inp_pos dd inp_end-fn_input
|
|||||||
entered dd 0
|
entered dd 0
|
||||||
|
|
||||||
file_info:
|
file_info:
|
||||||
dd 0
|
dd 0 ; subfunction - read
|
||||||
dd 0
|
dd 0, 0 ; file offset
|
||||||
dd 0x100
|
dd 0x20000 ; number of bytes to read
|
||||||
cnf_level dd strip
|
cnf_level dd strip ; data buffer
|
||||||
dd workarea
|
file_name db CUR_DIR ; Filename
|
||||||
file_name db CUR_DIR
|
|
||||||
path_end db 'SKIN.'
|
path_end db 'SKIN.'
|
||||||
file_num db 'RAW',0
|
file_num db 'RAW',0
|
||||||
|
|
||||||
@ -1149,10 +1138,8 @@ color db ?
|
|||||||
colcount db ?
|
colcount db ?
|
||||||
levelcount dd ?
|
levelcount dd ?
|
||||||
checkcount db ?
|
checkcount db ?
|
||||||
checkpoint:
|
checkpoint rw 256
|
||||||
times 256 dw ?
|
levelmap rd 1024
|
||||||
levelmap:
|
|
||||||
times 1024 dd ?
|
|
||||||
strip rb SKIN_SIZE
|
strip rb SKIN_SIZE
|
||||||
|
|
||||||
workarea:
|
workarea:
|
||||||
|
Loading…
Reference in New Issue
Block a user