Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. SMZ_levelp:
  2.     call get_xy_sf
  3.     xor  eax,eax
  4.     mov  [stepptr],esi
  5.     lodsb
  6.     mov  [cur_step],esi
  7.     add  esi,eax
  8.     mov  [levptr],esi
  9.     call unpack_level
  10.     ret
  11.  
  12. SMZ_key:
  13.     cmp  eax,176
  14.     jb   .ex
  15.     cmp  eax,179
  16.     ja   .ex
  17.     mov  ecx,[cur_step]
  18.     movzx ecx,byte[ecx]
  19.     lea  ebx,[eax-176]
  20.     mov  eax,[player]
  21.   .lp:
  22.     call check_move
  23.     jc   .exl
  24.     add  eax,[dirs+ebx*4]
  25.     loop .lp
  26.   .exl:
  27.     test ecx,ecx
  28.     jne  .ex
  29.     mov  [player],eax
  30.     cmp  eax,[finish]
  31.     jne  .nowin
  32.     mov  [win_flag],1
  33.   .nowin:
  34.     mov  esi,[stepptr]
  35.     movzx eax,byte[esi]
  36.     inc  esi
  37.     lea  ebx,[esi+eax]
  38.     inc  [cur_step]
  39.     cmp  [cur_step],ebx
  40.     jb   .ex
  41.     mov  [cur_step],esi
  42.   .ex:
  43.     ret
  44.  
  45. SMZ_drawm:
  46.     mov  eax,[player]
  47.     call get_xy
  48.     mcall 13,[lx],[ly],0xff00
  49.     mov  eax,[finish]
  50.     call get_xy
  51.     mcall 13,[lx],[ly],0xff0000
  52.     cmp  [win_flag],1
  53.     je   .ex
  54.     mov  edi,[stepptr]
  55.     movzx ecx,byte[edi]
  56.     inc  edi
  57.     mov  edx,(XFOFS+MSGXO) shl 16+42
  58.     mov  ebx,0x010000
  59.     mov  eax,47
  60.   .lp:
  61.     push ecx
  62.     mov  esi,0x10000000
  63.     movzx ecx,byte[edi]
  64.     cmp  edi,[cur_step]
  65.     jne  .nocur
  66.     mov  esi,0x100000ff
  67.     mcall
  68.     add  edx,1 shl 16
  69.   .nocur:
  70.     mcall
  71.     pop  ecx
  72.     add  edx,10 shl 16
  73.     inc  edi
  74.     loop .lp
  75.   .ex:
  76.     ret
  77.  
  78. SMZ_level:
  79. file 'smz.bin'
  80.  
  81. if lang eq ru
  82.         SMZ_help mstr \
  83.         '®¢â®àï©â¥ ¯®á«¥¤®¢ â¥«ì­®áâì 室®¢, ¤¢¨£ ï',\
  84.         '§¥«¥­ë© ª¢ ¤à â ­  ¯®¤á¢¥ç¥­­®¥ ª®«¨ç¥á⢮ ª«¥â®ª',\
  85.         '¯® ¯àאַ©, ¯®ª  ­¥ ¤®á⨣­¥â¥ ªà á­®£® ª¢ ¤à â .','',\
  86.   'http://puzzleprograms.narod.ru'
  87. else
  88.         SMZ_help mstr \
  89.         'Repeat sequence shown above the field moving the',\
  90.         'green square by highlighted count of spaces as',\
  91.         'many times as you like, until you finish at the',\
  92.         'red square.','',\
  93.   'http://puzzleprograms.narod.ru'
  94. end if
  95.