Subversion Repositories Kolibri OS

Rev

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

  1. ;---------------------------------------------------------------------
  2. load_file:
  3.         mov     esi,path
  4.         mov     edi,file_name
  5.         call    copy_file_path
  6.  
  7.         mov     [fileinfo.subfunction],dword 5
  8.         mov     [fileinfo.size],dword 0
  9.         mov     [fileinfo.return],dword file_info
  10.         mcall   70,fileinfo
  11.         test    eax,eax
  12.         jnz     .error
  13.  
  14.         mov     [fileinfo.subfunction],dword 0
  15.  
  16.         mov     ecx,[file_info+32]
  17.         mov     [fileinfo.size],ecx
  18.         mov     [img_size],ecx
  19.        
  20.         mcall   68,12
  21.         test    eax,eax
  22.         jz      memory_get_error
  23.  
  24.         mov     [fileinfo.return],eax
  25.         mov     [image_file],eax
  26.  
  27.         mcall   70,fileinfo
  28.         test    eax,eax
  29.         jnz     .error
  30.         ret
  31. .error:
  32.         mov     [N_error],2
  33.         mov     [error_type],eax
  34.         jmp     button.exit
  35. ;---------------------------------------------------------------------
  36. copy_file_path:
  37.         xor     eax,eax
  38.         cld
  39. @@:
  40.         lodsb
  41.         stosb
  42.         test    eax,eax
  43.         jnz     @b
  44.         mov     esi,edi
  45.         dec     esi
  46.         std
  47. @@:
  48.         lodsb
  49.         cmp     al,'/'
  50.         jnz     @b
  51.         mov     edi,esi
  52.         add     edi,2
  53.         mov     esi,ebx
  54.         cld
  55. @@:
  56.         lodsb
  57.         stosb
  58.         test    eax,eax
  59.         jnz     @b
  60.         ret
  61. ;---------------------------------------------------------------------
  62. load_and_convert_current_icon_set:
  63.         call    load_file
  64.         call    convert_icons
  65.         mov     eax,[raw_pointer]
  66.         ret
  67. ;---------------------------------------------------------------------
  68. ; load and convert icons       
  69. ;       mov     ebx,npc_miku_kick_icons_file_name
  70. ;       call    load_and_convert_current_icon_set
  71. ;       mov     [npc_miku_kick_icons],eax
  72. ;       DEBUGF  1, "npc_miku_kick_icons_file_name: %s\n",npc_miku_kick_icons_file_name
  73. ;       DEBUGF  1, "size x: %x\n",[eax+4]
  74. ;       DEBUGF  1, "size x: %x\n",[eax+8]
  75. ;       DEBUGF  1, "common depth: %x\n",[eax+12]
  76. ;       DEBUGF  1, "channel depth: %x\n",[eax+16]:2
  77. ;       DEBUGF  1, "channel value: %x\n",[eax+18]:2
  78. ;       DEBUGF  1, "palette offset: %x\n",[eax+20]
  79. ;       DEBUGF  1, "palette size: %x\n",[eax+24]
  80. ;       DEBUGF  1, "data offset: %x\n",[eax+28]
  81. ;       DEBUGF  1, "data size: %x\n",[eax+32]
  82. ;       DEBUGF  1, "transparency offset: %x\n",[eax+36]
  83. ;       DEBUGF  1, "transparency size: %x\n",[eax+40]
  84. ;---------------------------------------------------------------------
  85. load_and_convert_all_icons:
  86. ; load and convert font icons  
  87.         mov     ebx,font_icons_file_name
  88.         call    load_and_convert_current_icon_set
  89.         mov     [font_icons],eax
  90. ;       DEBUGF  1, "font_icons: %x\n",eax
  91.  
  92. ; load and convert base icons  
  93.         mov     ebx,base_icons_file_name
  94.         call    load_and_convert_current_icon_set
  95.         mov     [base_icons],eax
  96. ;       DEBUGF  1, "base_icons: %x\n",eax
  97.  
  98. ; load and convert red brick
  99.         mov     ebx,red_brick_icons_file_name  
  100.         call    load_and_convert_current_icon_set
  101.         mov     [red_brick_icons],eax
  102. ;       DEBUGF  1, "red_brick_icons: %x\n",eax
  103.  
  104. ; load and convert white brick
  105.         mov     ebx,white_brick_icons_file_name
  106.         call    load_and_convert_current_icon_set
  107.         mov     [white_brick_icons],eax
  108. ;       DEBUGF  1, "white_brick_icons: %x\n",eax
  109.  
  110. ; load and convert miku
  111.         mov     ebx,npc_miku_icons_file_name
  112.         call    load_and_convert_current_icon_set
  113.         mov     [npc_miku_icons],eax
  114. ;       DEBUGF  1, "npc_miku_icons: %x\n",eax
  115.  
  116. ; load and convert death
  117.         mov     ebx,npc_death_icons_file_name
  118.         call    load_and_convert_current_icon_set
  119.         mov     [npc_death_icons],eax
  120. ;       DEBUGF  1, "npc_death_icons: %x\n",eax
  121.  
  122. ; load and convert skeleton
  123.         mov     ebx,npc_skeleton_icons_file_name
  124.         call    load_and_convert_current_icon_set
  125.         mov     [npc_skeleton_icons],eax
  126. ;       DEBUGF  1, "npc_skeleton_icons: %x\n",eax
  127.  
  128. ; load and convert ifrit
  129.         mov     ebx,npc_ifrit_icons_file_name
  130.         call    load_and_convert_current_icon_set
  131.         mov     [npc_ifrit_icons],eax
  132. ;       DEBUGF  1, "npc_ifrit_icons: %x\n",eax
  133.  
  134. ; load and convert barret
  135.         mov     ebx,npc_barret_icons_file_name
  136.         call    load_and_convert_current_icon_set
  137.         mov     [npc_barret_icons],eax
  138. ;       DEBUGF  1, "npc_barret_icons: %x\n",eax
  139.  
  140.         ret
  141. ;---------------------------------------------------------------------
  142. load_sound:
  143.         call    load_file
  144.         mov     eax,[fileinfo.return]
  145.         ret
  146. ;---------------------------------------------------------------------
  147. load_all_sound_files:
  148. ; load background music
  149.         mov     ebx,background_music_file_name
  150.         call    load_sound
  151.         mov     [background_music],eax
  152.        
  153. ; load stone kick sound
  154.         mov     ebx,stone_kick_sound_file_name
  155.         call    load_sound
  156.         mov     [stone_kick_sound],eax
  157.        
  158. ; load menu sound
  159.         mov     ebx,menu_sound_file_name
  160.         call    load_sound
  161.         mov     [menu_sound],eax
  162.  
  163.         ret
  164. ;---------------------------------------------------------------------