Subversion Repositories Kolibri OS

Rev

Rev 6327 | Rev 6352 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1.  
  2. mem_screen equ 1200*1000*3 ;à §¬¥à ¯ ¬ï⨠¤«ï ®¡« á⨠íªà ­ 
  3. mem_panel_b equ 50*(20*20*3) ;à §¬¥à ¯ ¬ï⨠¤«ï ¯ ­¥«¨ ¨­áâà㬥­â®¢
  4. mem_flood_f equ 500000 ;à §¬¥à ¡ãä¥à  ¤«ï § «¨¢ª¨,   â ª¦¥ ¤«ï ¯ «¨âàë
  5.  
  6. ;----------------------------------------------------------
  7. ;--------change size of memory which use program-----------
  8. ;----------------------------------------------------------
  9. GetMemory:
  10.         pusha
  11.         mov     ecx,[Picture_SizeX]
  12.         mov     edx,[Picture_SizeY]
  13.         imul    ecx,edx
  14.         lea     ecx,[ecx+ecx*2]
  15.         lea     ecx,[ecx+ecx*4] ;(Picture_SizeX*Picture_SizeY*3)*5
  16.         add     ecx,mem_screen+mem_panel_b+mem_flood_f
  17.         mcall SF_SYS_MISC,SSF_MEM_REALLOC,,[ScreenPointer]
  18.         test eax,eax
  19.         jnz     have_new_memory
  20.         mov     esi,sound_havent_memory
  21.         call    sound
  22.         popa
  23.         add     esp,4
  24.         jmp     still
  25.  
  26. have_new_memory:
  27.         mov     [ScreenPointer],eax
  28.         call    prepare_data_pointers
  29.         popa
  30.         ret
  31. ;---------------------------------------------------------
  32. prepare_data_pointers:
  33.         mov     eax,[Picture_SizeX]
  34.         mov     ebx,[Picture_SizeY]
  35.         imul    eax,ebx
  36.         lea     eax,[eax+eax*2]
  37.         mov     ebx,[ScreenPointer]
  38.         add     ebx,mem_screen+mem_panel_b+mem_flood_f
  39.  
  40.         mov     [PointerToPicture],ebx
  41.         mov     [PointerToCopyPicture],ebx
  42.         mov     [PointerToCopyPicture2],ebx
  43.         mov     [PointerToEditBufer],ebx
  44.         mov     [PointerToSpriteBufer],ebx
  45.  
  46.         add     [PointerToCopyPicture],eax
  47.  
  48.         add     [PointerToCopyPicture2],eax
  49.         add     [PointerToCopyPicture2],eax
  50.  
  51.         add     [PointerToEditBufer],eax
  52.         add     [PointerToEditBufer],eax
  53.         add     [PointerToEditBufer],eax
  54.  
  55.         shl eax,2
  56.         add     [PointerToSpriteBufer],eax
  57.  
  58.         mov     eax,[ScreenPointer]
  59.         add     eax,mem_screen+mem_panel_b
  60.         mov     [PointerToPalette],eax
  61.         mov     [ReserveArray],eax
  62.         ret
  63. ;---------------------------------------------------------