//////////////////////////////////////////////////////////////////////////////
//                                                                           /
// IAR ARM ANSI C/C++ Compiler V4.40A/W32 EVALUATION   28/Mar/2008  19:11:03 /
// Copyright 1999-2005 IAR Systems. All rights reserved.                     /
//                                                                           /
//    Cpu mode        =  interwork                                           /
//    Endian          =  little                                              /
//    Stack alignment =  4                                                   /
//    Source file     =  E:\Ivo\arm\IVOPLAY\mediafiles.c                     /
//    Command line    =  E:\Ivo\arm\IVOPLAY\mediafiles.c -D X75 -lC          /
//                       E:\Ivo\arm\IVOPLAY\ReleaseX75\List\ -lA             /
//                       E:\Ivo\arm\IVOPLAY\ReleaseX75\List\ -o              /
//                       E:\Ivo\arm\IVOPLAY\ReleaseX75\Obj\ -s9 --no_cse     /
//                       --no_unroll --no_inline --no_code_motion --no_tbaa  /
//                       --no_clustering --no_scheduling --cpu_mode arm      /
//                       --endian little --cpu ARM926EJ-S --stack_align 4    /
//                       --interwork -e --fpu None --dlib_config             /
//                       D:\arm\ARM\LIB\dl5tpainl8n.h -I D:\arm\ARM\INC\     /
//    List file       =  E:\Ivo\arm\IVOPLAY\ReleaseX75\List\mediafiles.s79   /
//                                                                           /
//                                                                           /
//////////////////////////////////////////////////////////////////////////////

        NAME mediafiles

        RTMODEL "StackAlign4", "USED"
        RTMODEL "__cpu_mode", "__pcs__interwork"
        RTMODEL "__data_model", "absolute"
        RTMODEL "__endian", "little"
        RTMODEL "__rt_version", "6"

        RSEG CSTACK:DATA:NOROOT(2)

        PUBWEAK `?*?DATA_ID`
        MULTWEAK ??CloseMAINMENU??rA
??DataTable1 EQU 0
??DataTable10 EQU 0
??DataTable100 EQU 0
??DataTable101 EQU 0
??DataTable102 EQU 0
??DataTable103 EQU 0
??DataTable104 EQU 0
??DataTable105 EQU 0
??DataTable106 EQU 0
??DataTable107 EQU 0
??DataTable108 EQU 0
??DataTable109 EQU 0
??DataTable11 EQU 0
??DataTable110 EQU 0
??DataTable111 EQU 0
??DataTable112 EQU 0
??DataTable113 EQU 0
??DataTable117 EQU 0
??DataTable118 EQU 0
??DataTable119 EQU 0
??DataTable12 EQU 0
??DataTable120 EQU 0
??DataTable121 EQU 0
??DataTable123 EQU 0
??DataTable124 EQU 0
??DataTable125 EQU 0
??DataTable126 EQU 0
??DataTable128 EQU 0
??DataTable129 EQU 0
??DataTable13 EQU 0
??DataTable130 EQU 0
??DataTable133 EQU 0
??DataTable136 EQU 0
??DataTable137 EQU 0
??DataTable14 EQU 0
??DataTable140 EQU 0
??DataTable141 EQU 0
??DataTable142 EQU 0
??DataTable143 EQU 0
??DataTable144 EQU 0
??DataTable146 EQU 0
??DataTable148 EQU 0
??DataTable15 EQU 0
??DataTable16 EQU 0
??DataTable17 EQU 0
??DataTable18 EQU 0
??DataTable19 EQU 0
??DataTable2 EQU 0
??DataTable20 EQU 0
??DataTable22 EQU 0
??DataTable23 EQU 0
??DataTable24 EQU 0
??DataTable25 EQU 0
??DataTable26 EQU 0
??DataTable27 EQU 0
??DataTable28 EQU 0
??DataTable29 EQU 0
??DataTable3 EQU 0
??DataTable30 EQU 0
??DataTable31 EQU 0
??DataTable32 EQU 0
??DataTable33 EQU 0
??DataTable34 EQU 0
??DataTable35 EQU 0
??DataTable36 EQU 0
??DataTable37 EQU 0
??DataTable38 EQU 0
??DataTable39 EQU 0
??DataTable4 EQU 0
??DataTable40 EQU 0
??DataTable41 EQU 0
??DataTable42 EQU 0
??DataTable43 EQU 0
??DataTable44 EQU 0
??DataTable45 EQU 0
??DataTable46 EQU 0
??DataTable47 EQU 0
??DataTable48 EQU 0
??DataTable49 EQU 0
??DataTable5 EQU 0
??DataTable50 EQU 0
??DataTable51 EQU 0
??DataTable52 EQU 0
??DataTable53 EQU 0
??DataTable54 EQU 0
??DataTable55 EQU 0
??DataTable56 EQU 0
??DataTable57 EQU 0
??DataTable58 EQU 0
??DataTable59 EQU 0
??DataTable6 EQU 0
??DataTable60 EQU 0
??DataTable61 EQU 0
??DataTable62 EQU 0
??DataTable64 EQU 0
??DataTable65 EQU 0
??DataTable66 EQU 0
??DataTable67 EQU 0
??DataTable68 EQU 0
??DataTable69 EQU 0
??DataTable7 EQU 0
??DataTable70 EQU 0
??DataTable71 EQU 0
??DataTable72 EQU 0
??DataTable73 EQU 0
??DataTable74 EQU 0
??DataTable75 EQU 0
??DataTable76 EQU 0
??DataTable77 EQU 0
??DataTable78 EQU 0
??DataTable79 EQU 0
??DataTable8 EQU 0
??DataTable80 EQU 0
??DataTable81 EQU 0
??DataTable82 EQU 0
??DataTable84 EQU 0
??DataTable85 EQU 0
??DataTable87 EQU 0
??DataTable88 EQU 0
??DataTable89 EQU 0
??DataTable90 EQU 0
??DataTable91 EQU 0
??DataTable92 EQU 0
??DataTable93 EQU 0
??DataTable94 EQU 0
??DataTable95 EQU 0
??DataTable96 EQU 0
??DataTable97 EQU 0
??DataTable98 EQU 0
??DataTable99 EQU 0
        MULTWEAK ??GetFon??rA
        MULTWEAK ??GetKatalogbackgroundcolour??rA
        MULTWEAK ??GetKatalogfontcolour??rA
        MULTWEAK ??MenuKeys3??rT
        MULTWEAK ??Message??rA
        MULTWEAK ??OnRedraw4??rT
        MULTWEAK ??ViewFiles??rT
        MULTWEAK ??main??rA
        PUBWEAK ?init?tab?DATA_I
        PUBWEAK ?init?tab?DATA_Z
        PUBLIC Canvas3
        PUBLIC GUI2
        PUBLIC MenuKeys3
        FUNCTION MenuKeys3,0603H
        LOCFRAME CSTACK, 828, STACK
        PUBLIC OnRedraw4
        FUNCTION OnRedraw4,0603H
        LOCFRAME CSTACK, 84, STACK
        PUBLIC ToView
        PUBLIC ViewFiles
        FUNCTION ViewFiles,0201H
        LOCFRAME CSTACK, 812, STACK
        PUBLIC albums
        PUBLIC artists
        PUBLIC curent
        PUBLIC gui_methods4
        PUBLIC masyv
        PUBLIC max_alb
        PUBLIC max_art
        PUBLIC max_tra
        PUBLIC select_alb
        PUBLIC select_art
        PUBLIC select_tra
        PUBLIC tracks
        
        CFI Names cfiNames0
        CFI StackFrame CFA R13 HUGEDATA
        CFI Resource R0:32, R1:32, R2:32, R3:32, R4:32, R5:32, R6:32, R7:32
        CFI Resource R8:32, R9:32, R10:32, R11:32, R12:32, CPSR:32, R13:32
        CFI Resource R14:32, SPSR:32
        CFI VirtualResource ?RET:32
        CFI EndNames cfiNames0
        
        CFI Common cfiCommon0 Using cfiNames0
        CFI CodeAlign 2
        CFI DataAlign 4
        CFI ReturnAddress ?RET CODE
        CFI CFA R13+0
        CFI R0 Undefined
        CFI R1 Undefined
        CFI R2 Undefined
        CFI R3 Undefined
        CFI R4 SameValue
        CFI R5 SameValue
        CFI R6 SameValue
        CFI R7 SameValue
        CFI R8 SameValue
        CFI R9 SameValue
        CFI R10 SameValue
        CFI R11 SameValue
        CFI R12 Undefined
        CFI CPSR SameValue
        CFI R14 Undefined
        CFI SPSR SameValue
        CFI ?RET R14
        CFI EndCommon cfiCommon0
        
        
        CFI Common cfiCommon1 Using cfiNames0
        CFI CodeAlign 4
        CFI DataAlign 4
        CFI ReturnAddress ?RET CODE
        CFI CFA R13+0
        CFI R0 Undefined
        CFI R1 Undefined
        CFI R2 Undefined
        CFI R3 Undefined
        CFI R4 SameValue
        CFI R5 SameValue
        CFI R6 SameValue
        CFI R7 SameValue
        CFI R8 SameValue
        CFI R9 SameValue
        CFI R10 SameValue
        CFI R11 SameValue
        CFI R12 Undefined
        CFI CPSR SameValue
        CFI R14 Undefined
        CFI SPSR SameValue
        CFI ?RET R14
        CFI EndCommon cfiCommon1
        
CloseMAINMENU       SYMBOL "CloseMAINMENU"
GetFon              SYMBOL "GetFon"
GetKatalogbackgroundcolour SYMBOL "GetKatalogbackgroundcolour"
GetKatalogfontcolour SYMBOL "GetKatalogfontcolour"
Message             SYMBOL "Message"
main                SYMBOL "main"
??CloseMAINMENU??rA SYMBOL "??rA", CloseMAINMENU
??GetFon??rA        SYMBOL "??rA", GetFon
??GetKatalogbackgroundcolour??rA SYMBOL "??rA", GetKatalogbackgroundcolour
??GetKatalogfontcolour??rA SYMBOL "??rA", GetKatalogfontcolour
MenuKeys3           SYMBOL "MenuKeys3"
??MenuKeys3??rT     SYMBOL "??rT", MenuKeys3
??Message??rA       SYMBOL "??rA", Message
OnRedraw4           SYMBOL "OnRedraw4"
??OnRedraw4??rT     SYMBOL "??rT", OnRedraw4
ViewFiles           SYMBOL "ViewFiles"
??ViewFiles??rT     SYMBOL "??rT", ViewFiles
??main??rA          SYMBOL "??rA", main

        EXTERN CloseMAINMENU
        FUNCTION CloseMAINMENU,0200H
        EXTERN GetFon
        FUNCTION GetFon,0200H
        EXTERN GetKatalogbackgroundcolour
        FUNCTION GetKatalogbackgroundcolour,0200H
        EXTERN GetKatalogfontcolour
        FUNCTION GetKatalogfontcolour,0200H
        EXTERN Message
        FUNCTION Message,0202H
        EXTERN kill_data
        FUNCTION kill_data,0602H
        EXTERN main
        FUNCTION main,0a02H
        EXTERN method
        FUNCTION method,0602H
        EXTERN onClose2
        FUNCTION onClose2,0602H
        EXTERN onCreate2
        FUNCTION onCreate2,0602H
        EXTERN onFocus2
        FUNCTION onFocus2,0602H
        EXTERN onUnfocus2
        FUNCTION onUnfocus2,0602H
        EXTERN playerfolder


        RSEG DATA_C:CONST:SORT:NOROOT(2)
`?<Constant "%i%c%i">`:
        DATA
        DC8 "%i%c%i"
        DC8 0

        RSEG DATA_C:CONST:SORT:NOROOT(2)
`?<Constant "\\302\\350\\352\\356\\355\\340\\342\\366i.`:
        DATA
        DC8 "\302\350\352\356\355\340\342\366i..."
        DC8 0, 0, 0

        RSEG DATA_C:CONST:SORT:NOROOT(2)
`?<Constant "%s%c">`:
        DATA
        DC8 "%s%c"
        DC8 0, 0, 0

        RSEG DATA_C:CONST:SORT:NOROOT(2)
`?<Constant "%smedia.ipl">`:
        DATA
        DC8 "%smedia.ipl"

        RSEG DATA_C:CONST:SORT:NOROOT(2)
`?<Constant "%c%c%c\\r\\n">`:
        DATA
        DC8 "%c%c%c\015\012"
        DC8 0, 0, 0

        RSEG DATA_C:CONST:SORT:NOROOT(2)
        DATA
        DC8 ""
        DC8 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
        DC8 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
        DC8 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
        DC8 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
        DC8 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
        DC8 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
        DC8 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
        DC8 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
        DC8 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
        DC8 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
        DC8 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
        DC8 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
        DC8 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
        DC8 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
        DC8 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
        DC8 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0

        RSEG DATA_C:CONST:SORT:NOROOT(2)
`?<Constant "%s\\r\\n">`:
        DATA
        DC8 "%s\015\012"
        DC8 0, 0, 0

        RSEG DATA_C:CONST:SORT:NOROOT(0)
        DATA
        DC8 "*"

        RSEG DATA_C:CONST:SORT:NOROOT(2)
`?<Constant "%sivoplay.elf">`:
        DATA
        DC8 "%sivoplay.elf"
        DC8 0, 0

        RSEG DATA_C:CONST:SORT:NOROOT(2)
`?<Constant "\\315\\345 \\354\\356\\346\\363 \\361\\362`:
        DATA
        DC8 "\315\345 \354\356\346\363 \361\362\342\356\360\350\362\350 \364\340\351\353!"
        DC8 0

        RSEG DATA_C:CONST:SORT:NOROOT(2)
`?<Constant "%smediafiiles.txt">`:
        DATA
        DC8 "%smediafiiles.txt"
        DC8 0, 0

        RSEG DATA_C:CONST:SORT:NOROOT(0)
        DATA
        DC8 ""
// E:\Ivo\arm\IVOPLAY\mediafiles.c
//    1 #include "../inc/swilib.h"
//    2 #include "language.h"
//    3 #include "main.h"

        RSEG DATA_C:CONST:SORT:NOROOT(0)
// static char const __data pt[3]
pt:
        DATA
        DC8 "%t"

        RSEG DATA_C:CONST:SORT:NOROOT(0)
// static char const __data pp[1]
pp:
        DATA
        DC8 ""
//    4 #include "mainmenu.h"
//    5 #include "conf_loader.h"
//    6 
//    7 extern const char playerfolder[128];
//    8 

        RSEG DATA_Z:DATA:SORT:NOROOT(2)
//    9 int curent=0,select_art=0,select_alb=0,select_tra=0,max_art,max_alb,max_tra;
curent:
        DS8 4

        RSEG DATA_Z:DATA:SORT:NOROOT(2)
select_art:
        DS8 4

        RSEG DATA_Z:DATA:SORT:NOROOT(2)
select_alb:
        DS8 4

        RSEG DATA_Z:DATA:SORT:NOROOT(2)
select_tra:
        DS8 4

        RSEG DATA_Z:DATA:SORT:NOROOT(2)
max_art:
        DS8 4

        RSEG DATA_Z:DATA:SORT:NOROOT(2)
max_alb:
        DS8 4

        RSEG DATA_Z:DATA:SORT:NOROOT(2)
max_tra:
        DS8 4

        RSEG DATA_I:DATA:SORT:NOROOT(2)
//   10 int ToView=1;
ToView:
        DS8 4
        REQUIRE `?<Initializer for ToView>`

        RSEG DATA_Z:DATA:SORT:NOROOT(2)
//   11 char masyv[30000];
masyv:
        DS8 30000
//   12 typedef struct
//   13 {
//   14   char c[30];
//   15   int i;
//   16 }p;

        RSEG DATA_Z:DATA:SORT:NOROOT(2)
//   17 p artists[50],albums[50],tracks[200];
artists:
        DS8 1800

        RSEG DATA_Z:DATA:SORT:NOROOT(2)
albums:
        DS8 1800

        RSEG DATA_Z:DATA:SORT:NOROOT(2)
tracks:
        DS8 7200

        RSEG DATA_C:CONST:SORT:NOROOT(2)
//   18 const RECT Canvas3={0,0,131,175};
Canvas3:
        DATA
        DC16 0, 0, 131, 175

        RSEG DATA_Z:DATA:SORT:NOROOT(2)
//   19 int GUI2;
GUI2:
        DS8 4

        RSEG CODE:CODE:NOROOT(2)
        CFI Block cfiBlock0 Using cfiCommon0
        CFI NoFunction
        THUMB
??OnRedraw4??rT:
        BX       PC
        Nop      
        CFI EndBlock cfiBlock0
        REQUIRE OnRedraw4

        RSEG CODE:CODE:NOROOT(2)
        CFI Block cfiBlock1 Using cfiCommon1
        CFI Function OnRedraw4
        ARM
//   20 void OnRedraw4(MAIN_GUI *data) // OnRedraw
//   21 {
OnRedraw4:
        PUSH     {R4-R11,LR}
        CFI ?RET Frame(CFA, -4)
        CFI R11 Frame(CFA, -8)
        CFI R10 Frame(CFA, -12)
        CFI R9 Frame(CFA, -16)
        CFI R8 Frame(CFA, -20)
        CFI R7 Frame(CFA, -24)
        CFI R6 Frame(CFA, -28)
        CFI R5 Frame(CFA, -32)
        CFI R4 Frame(CFA, -36)
        CFI CFA R13+36
        SUB      SP,SP,#+4
        CFI CFA R13+40
//   22   WSHDR* a=AllocWS(128);
        MOV      R0,#+128
        SWI      +293
        MOV      R4,R0
//   23   WSHDR* b=AllocWS(128);
        MOV      R0,#+128
        SWI      +293
        MOV      R5,R0
//   24   DrawImg(0,0,(int)GetFon());
        _BLF     GetFon,??GetFon??rA
        MOV      R2,R0
        MOV      R1,#+0
        MOV      R0,#+0
        SWI      +35
//   25   switch(ToView)
        LDR      R0,??DataTable0  ;; ToView
        LDR      R0,[R0, #+0]
        SUBS     R0,R0,#+1
        BEQ      ??OnRedraw4_0
        SUBS     R0,R0,#+1
        BEQ      ??OnRedraw4_1
        SUBS     R0,R0,#+1
        BEQ      ??OnRedraw4_2
        B        ??OnRedraw4_3
//   26   {
//   27   case 1:
//   28   {
//   29     int bottom,top;
//   30     if (max_art>9)
??OnRedraw4_0:
        LDR      R0,??DataTable9  ;; max_art
        LDR      R0,[R0, #+0]
        CMP      R0,#+10
        BLT      ??OnRedraw4_4
//   31     {
//   32     if((select_art-4)>=0){top=select_art-4;}else{top=0;}
        LDR      R0,??DataTable21  ;; select_art
        LDR      R0,[R0, #+0]
        SUBS     R0,R0,#+4
        BMI      ??OnRedraw4_5
        LDR      R0,??DataTable21  ;; select_art
        LDR      R0,[R0, #+0]
        SUB      R7,R0,#+4
        B        ??OnRedraw4_6
??OnRedraw4_5:
        MOV      R7,#+0
//   33     if (top+10<max_art){bottom=max_art;}
//   34     bottom=top+9;
??OnRedraw4_6:
        ADD      R6,R7,#+9
//   35     if(bottom>max_art)
        LDR      R0,??DataTable9  ;; max_art
        LDR      R0,[R0, #+0]
        CMP      R0,R6
        BGE      ??OnRedraw4_7
//   36     {
//   37       while (bottom!=max_art) {bottom--;top--;}
??OnRedraw4_8:
        LDR      R0,??DataTable9  ;; max_art
        LDR      R0,[R0, #+0]
        CMP      R6,R0
        BEQ      ??OnRedraw4_7
        SUB      R6,R6,#+1
        SUB      R7,R7,#+1
        B        ??OnRedraw4_8
//   38     }
//   39     }
//   40     else
//   41     {
//   42       top=0;
??OnRedraw4_4:
        MOV      R7,#+0
//   43       bottom=max_art;
        LDR      R0,??DataTable9  ;; max_art
        LDR      R6,[R0, #+0]
//   44     }
//   45     int bkcolor=23;
//   46     if (max_art!=0)
        CMP      R6,#+0
        BEQ      ??OnRedraw4_9
//   47     {
//   48     for (int i=top;i<bottom;i++)
??OnRedraw4_7:
        CMP      R7,R6
        BGE      ??OnRedraw4_9
        MOV      R8,#+33
        MOV      R0,#+36
        LDR      R1,??DataTable63  ;; artists
        MLA      R9,R0,R7,R1
//   49     {
//   50         int colour=GetKatalogfontcolour();
??OnRedraw4_10:
        _BLF     GetKatalogfontcolour,??GetKatalogfontcolour??rA
        MOV      R10,R0
//   51         if (i==select_art)
        LDR      R0,??DataTable21  ;; select_art
        LDR      R0,[R0, #+0]
        CMP      R7,R0
        BNE      ??OnRedraw4_11
//   52       {
//   53         bkcolor=GetKatalogbackgroundcolour();
        _BLF     GetKatalogbackgroundcolour,??GetKatalogbackgroundcolour??rA
        MOV      R11,R0
        B        ??OnRedraw4_12
//   54       }
//   55       else
//   56       {
//   57         bkcolor=23;
??OnRedraw4_11:
        MOV      R11,#+23
//   58       }
//   59         utf8_2ws(a,artists[i].c,320);
??OnRedraw4_12:
        MOV      R2,#+320
        MOV      R1,R9
        MOV      R0,R4
        SWI      +483
//   60         wsprintf(a,pt,artists[i].c);
        MOV      R2,R9
        LDR      R1,??OnRedraw4_13  ;; pt
        MOV      R0,R4
        SWI      +292
//   61         if (Get_WS_width(a,7)<Get_WS_width(b,7))
        MOV      R1,#+7
        MOV      R0,R4
        SWI      +520
        STR      R0,[SP, #+0]
        PUSH     {R0}
        CFI CFA R13+44
        MOV      R1,#+7
        MOV      R0,R5
        SWI      +520
        POP      {R1}
        CFI CFA R13+40
        CMP      R1,R0
        MOV      R0,R11
        BGE      ??OnRedraw4_14
//   62         {
//   63           DrawString(b,2,(i-top)*15+22,1000,(i-top+1)*15+18,7,TEXT_ALIGNLEFT,GetPaletteAdrByColorIndex(colour),GetPaletteAdrByColorIndex(bkcolor));
        SWI      +302
        MOV      R11,R0
        MOV      R0,R10
        SWI      +302
        PUSH     {R11}
        CFI CFA R13+44
        PUSH     {R0}
        CFI CFA R13+48
        MOV      R0,#+1
        PUSH     {R0}
        CFI CFA R13+52
        MOV      R0,#+7
        PUSH     {R0}
        CFI CFA R13+56
        MOV      R0,R8
        PUSH     {R0}
        CFI CFA R13+60
        MOV      R3,#+1000
        SUB      R2,R8,#+11
        MOV      R1,#+2
        MOV      R0,R5
        B        ??OnRedraw4_15
        CFI CFA R13+40
//   64         }
//   65         else
//   66         {
//   67           DrawString(a,2,(i-top)*15+22,1000,(i-top+1)*15+18,7,TEXT_ALIGNLEFT,GetPaletteAdrByColorIndex(colour),GetPaletteAdrByColorIndex(bkcolor));
??OnRedraw4_14:
        SWI      +302
        MOV      R11,R0
        MOV      R0,R10
        SWI      +302
        PUSH     {R11}
        CFI CFA R13+44
        PUSH     {R0}
        CFI CFA R13+48
        MOV      R0,#+1
        PUSH     {R0}
        CFI CFA R13+52
        MOV      R0,#+7
        PUSH     {R0}
        CFI CFA R13+56
        MOV      R0,R8
        PUSH     {R0}
        CFI CFA R13+60
        MOV      R3,#+1000
        SUB      R2,R8,#+11
        MOV      R1,#+2
        MOV      R0,R4
??OnRedraw4_15:
        SWI      +332
        ADD      SP,SP,#+20       ;; stack cleaning
        CFI CFA R13+40
//   68         }
//   69     }
        ADD      R7,R7,#+1
        ADD      R9,R9,#+36
        ADD      R8,R8,#+15
        CMP      R7,R6
        BLT      ??OnRedraw4_10
//   70     }
//   71     wsprintf(a,"%i%c%i",select_art+1,'/',max_art);
??OnRedraw4_9:
        LDR      R0,??DataTable9  ;; max_art
        LDR      R0,[R0, #+0]
        PUSH     {R0}
        CFI CFA R13+44
        MOV      R3,#+47
        LDR      R0,??DataTable21  ;; select_art
        LDR      R0,[R0, #+0]
        ADD      R2,R0,#+1
        LDR      R1,??OnRedraw4_13+0x4  ;; `?<Constant "%i%c%i">`
        MOV      R0,R4
        SWI      +292
//   72     DrawString(a,1,3,128,176,7,TEXT_ALIGNRIGHT,GetPaletteAdrByColorIndex(GetKatalogfontcolour()),GetPaletteAdrByColorIndex(23)); 
        MOV      R0,#+23
        SWI      +302
        MOV      R6,R0
        _BLF     GetKatalogfontcolour,??GetKatalogfontcolour??rA
        SWI      +302
        PUSH     {R6}
        CFI CFA R13+48
        PUSH     {R0}
        CFI CFA R13+52
        MOV      R0,#+4
        PUSH     {R0}
        CFI CFA R13+56
        MOV      R0,#+7
        PUSH     {R0}
        CFI CFA R13+60
        MOV      R0,#+176
        PUSH     {R0}
        CFI CFA R13+64
        MOV      R3,#+128
        MOV      R2,#+3
        MOV      R1,#+1
        MOV      R0,R4
        SWI      +332
//   73     wsprintf(a,pt,LG_ARTISTS);
        LDR      R2,??OnRedraw4_13+0x8  ;; `?<Constant "\\302\\350\\352\\356\\355\\340\\342\\366i.`
        B        ??OnRedraw4_16
        CFI CFA R13+40
//   74     DrawString(a,1,3,90,15,FONT_SMALL_BOLD,TEXT_ALIGNLEFT,GetPaletteAdrByColorIndex(GetKatalogfontcolour()),GetPaletteAdrByColorIndex(23));
//   75     //wsprintf(wss.ws1,pt,LG_REMOVE);
//   76     //DrawString(wss.ws1,1,163,130,176,7,TEXT_ALIGNLEFT,GetPaletteAdrByColorIndex(katalogfontcolour),GetPaletteAdrByColorIndex(23));
//   77     //wsprintf(wss.ws1,pt,LG_ADD);
//   78     //DrawString(wss.ws1,1,163,130,176,7,TEXT_ALIGNRIGHT,GetPaletteAdrByColorIndex(katalogfontcolour),GetPaletteAdrByColorIndex(23));
//   79     DrawLine(0,17,132,17,0,GetPaletteAdrByColorIndex(GetKatalogfontcolour()));
//   80     DrawLine(92,17,92,0,0,GetPaletteAdrByColorIndex(GetKatalogfontcolour()));
//   81   }break;
//   82   case 2:
//   83     {
//   84     int bottom,top;
//   85     if (max_alb>9)
??OnRedraw4_1:
        LDR      R0,??DataTable83  ;; max_alb
        LDR      R0,[R0, #+0]
        CMP      R0,#+10
        BLT      ??OnRedraw4_17
//   86     {
//   87     if((select_alb-4)>=0){top=select_alb-4;}else{top=0;}
        LDR      R0,??DataTable115  ;; select_alb
        LDR      R0,[R0, #+0]
        SUBS     R0,R0,#+4
        BMI      ??OnRedraw4_18
        LDR      R0,??DataTable115  ;; select_alb
        LDR      R0,[R0, #+0]
        SUB      R7,R0,#+4
        B        ??OnRedraw4_19
??OnRedraw4_18:
        MOV      R7,#+0
//   88     if (top+10<max_alb){bottom=max_alb;}
//   89     bottom=top+9;
??OnRedraw4_19:
        ADD      R6,R7,#+9
//   90     if(bottom>max_alb)
        LDR      R0,??DataTable83  ;; max_alb
        LDR      R0,[R0, #+0]
        CMP      R0,R6
        BGE      ??OnRedraw4_20
//   91     {
//   92       while (bottom!=max_alb) {bottom--;top--;}
??OnRedraw4_21:
        LDR      R0,??DataTable83  ;; max_alb
        LDR      R0,[R0, #+0]
        CMP      R6,R0
        BEQ      ??OnRedraw4_20
        SUB      R6,R6,#+1
        SUB      R7,R7,#+1
        B        ??OnRedraw4_21
//   93     }
//   94     }
//   95     else
//   96     {
//   97       top=0;
??OnRedraw4_17:
        MOV      R7,#+0
//   98       bottom=max_alb;
        LDR      R0,??DataTable83  ;; max_alb
        LDR      R6,[R0, #+0]
//   99     }
//  100     int bkcolor=23;
//  101     if (max_alb!=0)
        CMP      R6,#+0
        BEQ      ??OnRedraw4_22
//  102     {
//  103     for (int i=top;i<bottom;i++)
??OnRedraw4_20:
        CMP      R7,R6
        BGE      ??OnRedraw4_22
        MOV      R8,#+33
        MOV      R0,#+36
        LDR      R1,??DataTable116  ;; albums
        MLA      R9,R0,R7,R1
//  104     {
//  105         int colour=GetKatalogfontcolour();
??OnRedraw4_23:
        _BLF     GetKatalogfontcolour,??GetKatalogfontcolour??rA
        MOV      R10,R0
//  106         utf8_2ws(a,albums[i].c,320);
        MOV      R2,#+320
        MOV      R1,R9
        MOV      R0,R4
        SWI      +483
//  107         wsprintf(b,pt,albums[i].c);
        MOV      R2,R9
        LDR      R1,??OnRedraw4_13  ;; pt
        MOV      R0,R5
        SWI      +292
//  108         if (i==select_alb)
        LDR      R0,??DataTable115  ;; select_alb
        LDR      R0,[R0, #+0]
        CMP      R7,R0
        BNE      ??OnRedraw4_24
//  109       {
//  110         bkcolor=GetKatalogbackgroundcolour();
        _BLF     GetKatalogbackgroundcolour,??GetKatalogbackgroundcolour??rA
        MOV      R11,R0
        B        ??OnRedraw4_25
//  111       }
//  112       else
//  113       {
//  114         bkcolor=23;
??OnRedraw4_24:
        MOV      R11,#+23
//  115       }
//  116         if (Get_WS_width(a,7)<Get_WS_width(b,7))
??OnRedraw4_25:
        MOV      R1,#+7
        MOV      R0,R4
        SWI      +520
        STR      R0,[SP, #+0]
        PUSH     {R0}
        CFI CFA R13+44
        MOV      R1,#+7
        MOV      R0,R5
        SWI      +520
        POP      {R1}
        CFI CFA R13+40
        CMP      R1,R0
        MOV      R0,R11
        BGE      ??OnRedraw4_26
//  117         {
//  118           DrawString(b,2,(i-top)*15+22,1000,(i-top+1)*15+18,7,TEXT_ALIGNLEFT,GetPaletteAdrByColorIndex(colour),GetPaletteAdrByColorIndex(bkcolor));
        SWI      +302
        MOV      R11,R0
        MOV      R0,R10
        SWI      +302
        PUSH     {R11}
        CFI CFA R13+44
        PUSH     {R0}
        CFI CFA R13+48
        MOV      R0,#+1
        PUSH     {R0}
        CFI CFA R13+52
        MOV      R0,#+7
        PUSH     {R0}
        CFI CFA R13+56
        MOV      R0,R8
        PUSH     {R0}
        CFI CFA R13+60
        MOV      R3,#+1000
        SUB      R2,R8,#+11
        MOV      R1,#+2
        MOV      R0,R5
        B        ??OnRedraw4_27
        CFI CFA R13+40
//  119         }
//  120         else
//  121         {
//  122           DrawString(a,2,(i-top)*15+22,1000,(i-top+1)*15+18,7,TEXT_ALIGNLEFT,GetPaletteAdrByColorIndex(colour),GetPaletteAdrByColorIndex(bkcolor));
??OnRedraw4_26:
        SWI      +302
        MOV      R11,R0
        MOV      R0,R10
        SWI      +302
        PUSH     {R11}
        CFI CFA R13+44
        PUSH     {R0}
        CFI CFA R13+48
        MOV      R0,#+1
        PUSH     {R0}
        CFI CFA R13+52
        MOV      R0,#+7
        PUSH     {R0}
        CFI CFA R13+56
        MOV      R0,R8
        PUSH     {R0}
        CFI CFA R13+60
        MOV      R3,#+1000
        SUB      R2,R8,#+11
        MOV      R1,#+2
        MOV      R0,R4
??OnRedraw4_27:
        SWI      +332
        ADD      SP,SP,#+20       ;; stack cleaning
        CFI CFA R13+40
//  123         }
//  124     }
        ADD      R7,R7,#+1
        ADD      R9,R9,#+36
        ADD      R8,R8,#+15
        CMP      R7,R6
        BLT      ??OnRedraw4_23
//  125     }
//  126     wsprintf(a,"%i%c%i",select_alb+1,'/',max_alb);
??OnRedraw4_22:
        LDR      R0,??DataTable83  ;; max_alb
        LDR      R0,[R0, #+0]
        PUSH     {R0}
        CFI CFA R13+44
        MOV      R3,#+47
        LDR      R0,??DataTable115  ;; select_alb
        LDR      R0,[R0, #+0]
        ADD      R2,R0,#+1
        LDR      R1,??OnRedraw4_13+0x4  ;; `?<Constant "%i%c%i">`
        MOV      R0,R4
        SWI      +292
//  127     DrawString(a,1,3,128,176,7,TEXT_ALIGNRIGHT,GetPaletteAdrByColorIndex(GetKatalogfontcolour()),GetPaletteAdrByColorIndex(23)); 
        MOV      R0,#+23
        SWI      +302
        MOV      R6,R0
        _BLF     GetKatalogfontcolour,??GetKatalogfontcolour??rA
        SWI      +302
        PUSH     {R6}
        CFI CFA R13+48
        PUSH     {R0}
        CFI CFA R13+52
        MOV      R0,#+4
        PUSH     {R0}
        CFI CFA R13+56
        MOV      R0,#+7
        PUSH     {R0}
        CFI CFA R13+60
        MOV      R0,#+176
        PUSH     {R0}
        CFI CFA R13+64
        MOV      R3,#+128
        MOV      R2,#+3
        MOV      R1,#+1
        MOV      R0,R4
        SWI      +332
//  128     wsprintf(a,pt,artists[select_art].c);
        LDR      R0,??DataTable21  ;; select_art
        LDR      R0,[R0, #+0]
        MOV      R1,#+36
        LDR      R2,??DataTable63  ;; artists
        B        ??OnRedraw4_28
        CFI CFA R13+40
//  129     DrawString(a,1,3,90,15,FONT_SMALL_BOLD,TEXT_ALIGNLEFT,GetPaletteAdrByColorIndex(GetKatalogfontcolour()),GetPaletteAdrByColorIndex(23));
//  130     //wsprintf(wss.ws1,pt,LG_REMOVE);
//  131     //DrawString(wss.ws1,1,163,130,176,7,TEXT_ALIGNLEFT,GetPaletteAdrByColorIndex(katalogfontcolour),GetPaletteAdrByColorIndex(23));
//  132     //wsprintf(wss.ws1,pt,LG_ADD);
//  133     //DrawString(wss.ws1,1,163,130,176,7,TEXT_ALIGNRIGHT,GetPaletteAdrByColorIndex(katalogfontcolour),GetPaletteAdrByColorIndex(23));
//  134     DrawLine(0,17,132,17,0,GetPaletteAdrByColorIndex(GetKatalogfontcolour()));
//  135     DrawLine(92,17,92,0,0,GetPaletteAdrByColorIndex(GetKatalogfontcolour()));
//  136   }break;
//  137   case 3:
//  138     {
//  139     int bottom,top;
//  140     if (max_tra>9)
??OnRedraw4_2:
        LDR      R0,??DataTable127  ;; max_tra
        LDR      R0,[R0, #+0]
        CMP      R0,#+10
        BLT      ??OnRedraw4_29
//  141     {
//  142     if((select_tra-4)>=0){top=select_tra-4;}else{top=0;}
        LDR      R0,??DataTable122  ;; select_tra
        LDR      R0,[R0, #+0]
        SUBS     R0,R0,#+4
        BMI      ??OnRedraw4_30
        LDR      R0,??DataTable122  ;; select_tra
        LDR      R0,[R0, #+0]
        SUB      R7,R0,#+4
        B        ??OnRedraw4_31
??OnRedraw4_30:
        MOV      R7,#+0
//  143     if (top+10<max_tra){bottom=max_tra;}
//  144     bottom=top+9;
??OnRedraw4_31:
        ADD      R6,R7,#+9
//  145     if(bottom>max_tra)
        LDR      R0,??DataTable127  ;; max_tra
        LDR      R0,[R0, #+0]
        CMP      R0,R6
        BGE      ??OnRedraw4_32
//  146     {
//  147       while (bottom!=max_tra) {bottom--;top--;}
??OnRedraw4_33:
        LDR      R0,??DataTable127  ;; max_tra
        LDR      R0,[R0, #+0]
        CMP      R6,R0
        BEQ      ??OnRedraw4_32
        SUB      R6,R6,#+1
        SUB      R7,R7,#+1
        B        ??OnRedraw4_33
//  148     }
//  149     }
//  150     else
//  151     {
//  152       top=0;
??OnRedraw4_29:
        MOV      R7,#+0
//  153       bottom=max_tra;
        LDR      R0,??DataTable127  ;; max_tra
        LDR      R6,[R0, #+0]
//  154     }
//  155     int bkcolor=23;
//  156     if (max_tra!=0)
        CMP      R6,#+0
        BEQ      ??OnRedraw4_34
//  157     {
//  158     for (int i=top;i<bottom;i++)
??OnRedraw4_32:
        CMP      R7,R6
        BGE      ??OnRedraw4_34
        MOV      R8,#+33
        MOV      R0,#+36
        LDR      R1,??DataTable114  ;; tracks
        MLA      R9,R0,R7,R1
//  159     {
//  160         int colour=GetKatalogfontcolour();
??OnRedraw4_35:
        _BLF     GetKatalogfontcolour,??GetKatalogfontcolour??rA
        MOV      R10,R0
//  161         utf8_2ws(a,tracks[i].c,320);
        MOV      R2,#+320
        MOV      R1,R9
        MOV      R0,R4
        SWI      +483
//  162         wsprintf(b,pt,tracks[i].c);
        MOV      R2,R9
        LDR      R1,??OnRedraw4_13  ;; pt
        MOV      R0,R5
        SWI      +292
//  163         if (i==select_tra)
        LDR      R0,??DataTable122  ;; select_tra
        LDR      R0,[R0, #+0]
        CMP      R7,R0
        BNE      ??OnRedraw4_36
//  164       {
//  165         bkcolor=GetKatalogbackgroundcolour();
        _BLF     GetKatalogbackgroundcolour,??GetKatalogbackgroundcolour??rA
        MOV      R11,R0
        B        ??OnRedraw4_37
//  166       }
//  167       else
//  168       {
//  169         bkcolor=23;
??OnRedraw4_36:
        MOV      R11,#+23
//  170       }
//  171         if (Get_WS_width(a,7)<Get_WS_width(b,7))
??OnRedraw4_37:
        MOV      R1,#+7
        MOV      R0,R4
        SWI      +520
        STR      R0,[SP, #+0]
        PUSH     {R0}
        CFI CFA R13+44
        MOV      R1,#+7
        MOV      R0,R5
        SWI      +520
        POP      {R1}
        CFI CFA R13+40
        CMP      R1,R0
        MOV      R0,R11
        BGE      ??OnRedraw4_38
//  172         {
//  173           DrawString(b,2,(i-top)*15+22,1000,(i-top+1)*15+18,7,TEXT_ALIGNLEFT,GetPaletteAdrByColorIndex(colour),GetPaletteAdrByColorIndex(bkcolor));
        SWI      +302
        MOV      R11,R0
        MOV      R0,R10
        SWI      +302
        PUSH     {R11}
        CFI CFA R13+44
        PUSH     {R0}
        CFI CFA R13+48
        MOV      R0,#+1
        PUSH     {R0}
        CFI CFA R13+52
        MOV      R0,#+7
        PUSH     {R0}
        CFI CFA R13+56
        MOV      R0,R8
        PUSH     {R0}
        CFI CFA R13+60
        MOV      R3,#+1000
        SUB      R2,R8,#+11
        MOV      R1,#+2
        MOV      R0,R5
        B        ??OnRedraw4_39
        CFI CFA R13+40
//  174         }
//  175         else
//  176         {
//  177           DrawString(a,2,(i-top)*15+22,1000,(i-top+1)*15+18,7,TEXT_ALIGNLEFT,GetPaletteAdrByColorIndex(colour),GetPaletteAdrByColorIndex(bkcolor));
??OnRedraw4_38:
        SWI      +302
        MOV      R11,R0
        MOV      R0,R10
        SWI      +302
        PUSH     {R11}
        CFI CFA R13+44
        PUSH     {R0}
        CFI CFA R13+48
        MOV      R0,#+1
        PUSH     {R0}
        CFI CFA R13+52
        MOV      R0,#+7
        PUSH     {R0}
        CFI CFA R13+56
        MOV      R0,R8
        PUSH     {R0}
        CFI CFA R13+60
        MOV      R3,#+1000
        SUB      R2,R8,#+11
        MOV      R1,#+2
        MOV      R0,R4
??OnRedraw4_39:
        SWI      +332
        ADD      SP,SP,#+20       ;; stack cleaning
        CFI CFA R13+40
//  178         }
//  179     }
        ADD      R7,R7,#+1
        ADD      R9,R9,#+36
        ADD      R8,R8,#+15
        CMP      R7,R6
        BLT      ??OnRedraw4_35
//  180     }
//  181     wsprintf(a,"%i%c%i",select_tra+1,'/',max_tra);
??OnRedraw4_34:
        LDR      R0,??DataTable127  ;; max_tra
        LDR      R0,[R0, #+0]
        PUSH     {R0}
        CFI CFA R13+44
        MOV      R3,#+47
        LDR      R0,??DataTable122  ;; select_tra
        LDR      R0,[R0, #+0]
        ADD      R2,R0,#+1
        LDR      R1,??OnRedraw4_13+0x4  ;; `?<Constant "%i%c%i">`
        MOV      R0,R4
        SWI      +292
//  182     DrawString(a,1,3,128,176,7,TEXT_ALIGNRIGHT,GetPaletteAdrByColorIndex(GetKatalogfontcolour()),GetPaletteAdrByColorIndex(23)); 
        MOV      R0,#+23
        SWI      +302
        MOV      R6,R0
        _BLF     GetKatalogfontcolour,??GetKatalogfontcolour??rA
        SWI      +302
        PUSH     {R6}
        CFI CFA R13+48
        PUSH     {R0}
        CFI CFA R13+52
        MOV      R0,#+4
        PUSH     {R0}
        CFI CFA R13+56
        MOV      R0,#+7
        PUSH     {R0}
        CFI CFA R13+60
        MOV      R0,#+176
        PUSH     {R0}
        CFI CFA R13+64
        MOV      R3,#+128
        MOV      R2,#+3
        MOV      R1,#+1
        MOV      R0,R4
        SWI      +332
//  183     wsprintf(a,pt,albums[select_alb].c);
        LDR      R0,??DataTable115  ;; select_alb
        LDR      R0,[R0, #+0]
        MOV      R1,#+36
        LDR      R2,??DataTable116  ;; albums
??OnRedraw4_28:
        MLA      R2,R1,R0,R2
??OnRedraw4_16:
        LDR      R1,??OnRedraw4_13  ;; pt
        MOV      R0,R4
        SWI      +292
//  184     DrawString(a,1,3,90,15,FONT_SMALL_BOLD,TEXT_ALIGNLEFT,GetPaletteAdrByColorIndex(GetKatalogfontcolour()),GetPaletteAdrByColorIndex(23));
        MOV      R0,#+23
        SWI      +302
        MOV      R6,R0
        _BLF     GetKatalogfontcolour,??GetKatalogfontcolour??rA
        SWI      +302
        PUSH     {R6}
        CFI CFA R13+68
        PUSH     {R0}
        CFI CFA R13+72
        MOV      R0,#+1
        PUSH     {R0}
        CFI CFA R13+76
        MOV      R0,#+8
        PUSH     {R0}
        CFI CFA R13+80
        MOV      R0,#+15
        PUSH     {R0}
        CFI CFA R13+84
        MOV      R3,#+90
        MOV      R2,#+3
        MOV      R1,#+1
        MOV      R0,R4
        SWI      +332
        ADD      SP,SP,#+44       ;; stack cleaning
        CFI CFA R13+40
//  185     //wsprintf(wss.ws1,pt,LG_REMOVE);
//  186     //DrawString(wss.ws1,1,163,130,176,7,TEXT_ALIGNLEFT,GetPaletteAdrByColorIndex(katalogfontcolour),GetPaletteAdrByColorIndex(23));
//  187     //wsprintf(wss.ws1,pt,LG_ADD);
//  188     //DrawString(wss.ws1,1,163,130,176,7,TEXT_ALIGNRIGHT,GetPaletteAdrByColorIndex(katalogfontcolour),GetPaletteAdrByColorIndex(23));
//  189     DrawLine(0,17,132,17,0,GetPaletteAdrByColorIndex(GetKatalogfontcolour()));
        _BLF     GetKatalogfontcolour,??GetKatalogfontcolour??rA
        SWI      +302
        PUSH     {R0}
        CFI CFA R13+44
        MOV      R0,#+0
        PUSH     {R0}
        CFI CFA R13+48
        MOV      R3,#+17
        MOV      R2,#+132
        MOV      R1,#+17
        SWI      +435
//  190     DrawLine(92,17,92,0,0,GetPaletteAdrByColorIndex(GetKatalogfontcolour()));
        _BLF     GetKatalogfontcolour,??GetKatalogfontcolour??rA
        SWI      +302
        PUSH     {R0}
        CFI CFA R13+52
        MOV      R0,#+0
        PUSH     {R0}
        CFI CFA R13+56
        MOV      R3,R0
        MOV      R2,#+92
        MOV      R1,#+17
        MOV      R0,R2
        SWI      +435
        ADD      SP,SP,#+16       ;; stack cleaning
        CFI CFA R13+40
//  191   }break;
//  192   }
//  193   FreeWS(a);
??OnRedraw4_3:
        MOV      R0,R4
        SWI      +297
//  194   FreeWS(b);
        MOV      R0,R5
        SWI      +297
//  195 }
        ADD      SP,SP,#+4        ;; stack cleaning
        CFI CFA R13+36
        POP      {R4-R11,PC}      ;; return
        DATA
??OnRedraw4_13:
        DC32     pt
        DC32     `?<Constant "%i%c%i">`
        DC32     `?<Constant "\\302\\350\\352\\356\\355\\340\\342\\366i.`
        CFI EndBlock cfiBlock1

        RSEG CODE:CODE:NOROOT(2)
        DATA
??DataTable0:
        DC32     ToView

        RSEG CODE:CODE:NOROOT(2)
        DATA
??DataTable9:
        DC32     max_art

        RSEG CODE:CODE:NOROOT(2)
        DATA
??DataTable21:
        DC32     select_art

        RSEG CODE:CODE:NOROOT(2)
        CFI Block cfiBlock2 Using cfiCommon0
        CFI NoFunction
        THUMB
??MenuKeys3??rT:
        BX       PC
        Nop      
        CFI EndBlock cfiBlock2
        REQUIRE MenuKeys3

        RSEG CODE:CODE:NOROOT(2)
        CFI Block cfiBlock3 Using cfiCommon1
        CFI Function MenuKeys3
        ARM
//  196 int MenuKeys3(MAIN_GUI *data, GUI_MSG *msg) //OnKey
//  197 {
MenuKeys3:
        PUSH     {R4-R7,LR}
        CFI ?RET Frame(CFA, -4)
        CFI R7 Frame(CFA, -8)
        CFI R6 Frame(CFA, -12)
        CFI R5 Frame(CFA, -16)
        CFI R4 Frame(CFA, -20)
        CFI CFA R13+20
        SUB      SP,SP,#+804
        CFI CFA R13+824
//  198   if (msg->gbsmsg->msg==KEY_DOWN)
        LDR      R0,[R1, #+4]
        LDRSH    R0,[R0, #+2]
        MOV      R2,#+147
        ORR      R2,R2,#0x100
        CMP      R0,R2
        BNE      ??MenuKeys3_1
//  199   {
//  200     switch(msg->gbsmsg->submess)
        LDR      R0,[R1, #+4]
        LDR      R0,[R0, #+4]
        SUB      R0,R0,#+4
        CMP      R0,#+56
        BHI      ??MenuKeys3_1
        ADR      R1,??MenuKeys3_0
        MOV      R0,R0, LSL #+1
        LDRH     R1,[R1, R0]
        ADD      PC,PC,R1, LSL #+2
        DATA
??MenuKeys3_0:
        DC16     +28,+476,+476,+476
        DC16     +476,+476,+476,+476
        DC16     +28,+476,+476,+476
        DC16     +476,+476,+476,+476
        DC16     +476,+476,+476,+476
        DC16     +476,+476,+123,+476
        DC16     +476,+476,+476,+476
        DC16     +476,+476,+476,+476
        DC16     +476,+476,+476,+476
        DC16     +476,+476,+476,+476
        DC16     +476,+476,+476,+476
        DC16     +476,+476,+37,+476
        DC16     +476,+123,+476,+476
        DC16     +76,+476,+476,+37
        DC16     +76,+0
        ARM
//  201     {
//  202     case RED_BUTTON:case RIGHT_SOFT:
//  203       {
//  204         ToView--;
??MenuKeys3_2:
        LDR      R0,??DataTable131  ;; ToView
        LDR      R1,??DataTable131  ;; ToView
        LDR      R1,[R1, #+0]
        SUB      R1,R1,#+1
        STR      R1,[R0, #+0]
//  205         if (!ToView) return(1);
        CMP      R1,#+0
        BNE      ??MenuKeys3_3
        MOV      R0,#+1
        B        ??MenuKeys3_4
//  206         REDRAW();
//  207       }break;
//  208     case UP_BUTTON:case'2':
//  209       {
//  210         switch(ToView)
??MenuKeys3_5:
        LDR      R0,??DataTable131  ;; ToView
        LDR      R0,[R0, #+0]
        SUBS     R0,R0,#+1
        BEQ      ??MenuKeys3_6
        SUBS     R0,R0,#+1
        BEQ      ??MenuKeys3_7
        SUBS     R0,R0,#+1
        BEQ      ??MenuKeys3_8
        B        ??MenuKeys3_3
//  211         {
//  212         case 1:
//  213           {
//  214             select_art--;
??MenuKeys3_6:
        LDR      R0,??DataTable86  ;; select_art
        LDR      R1,??DataTable86  ;; select_art
        LDR      R1,[R1, #+0]
        SUB      R1,R1,#+1
        STR      R1,[R0, #+0]
//  215             if (select_art==-1)
        CMN      R1,#+1
        BNE      ??MenuKeys3_3
//  216             {
//  217               select_art=max_art-1;
        LDR      R1,??DataTable135  ;; max_art
??MenuKeys3_9:
        LDR      R1,[R1, #+0]
        SUB      R1,R1,#+1
??MenuKeys3_10:
        STR      R1,[R0, #+0]
//  218             }
//  219           }break;
??MenuKeys3_11:
        B        ??MenuKeys3_3
//  220         case 2:
//  221           {
//  222             select_alb--;
??MenuKeys3_7:
        LDR      R0,??DataTable115  ;; select_alb
        LDR      R1,??DataTable115  ;; select_alb
        LDR      R1,[R1, #+0]
        SUB      R1,R1,#+1
        STR      R1,[R0, #+0]
//  223             if (select_alb==-1)
        CMN      R1,#+1
        BNE      ??MenuKeys3_3
//  224             {
//  225               select_alb=max_alb-1;
        LDR      R1,??DataTable83  ;; max_alb
        B        ??MenuKeys3_9
//  226             }
//  227           }break;
//  228         case 3:
//  229           {
//  230             select_tra--;
??MenuKeys3_8:
        LDR      R0,??DataTable122  ;; select_tra
        LDR      R1,??DataTable122  ;; select_tra
        LDR      R1,[R1, #+0]
        SUB      R1,R1,#+1
        STR      R1,[R0, #+0]
//  231             if (select_tra==-1)
        CMN      R1,#+1
        BNE      ??MenuKeys3_3
//  232             {
//  233               select_tra=max_tra-1;
        LDR      R1,??DataTable127  ;; max_tra
        B        ??MenuKeys3_9
//  234             }
//  235           }break;
//  236         }
//  237         REDRAW();
//  238       }break;
//  239     case DOWN_BUTTON:case'8':
//  240       {
//  241         switch(ToView)
??MenuKeys3_12:
        LDR      R0,??DataTable131  ;; ToView
        LDR      R0,[R0, #+0]
        SUBS     R0,R0,#+1
        BEQ      ??MenuKeys3_13
        SUBS     R0,R0,#+1
        BEQ      ??MenuKeys3_14
        SUBS     R0,R0,#+1
        BEQ      ??MenuKeys3_15
        B        ??MenuKeys3_3
//  242         {
//  243         case 1:
//  244           {
//  245             select_art++;
??MenuKeys3_13:
        LDR      R0,??DataTable86  ;; select_art
        LDR      R1,??DataTable86  ;; select_art
        LDR      R1,[R1, #+0]
        ADD      R1,R1,#+1
        STR      R1,[R0, #+0]
//  246             if (select_art==max_art)
        MOV      R0,R1
        LDR      R1,??DataTable135  ;; max_art
        LDR      R1,[R1, #+0]
        CMP      R0,R1
        BNE      ??MenuKeys3_3
//  247             {
//  248               select_art=0;
        LDR      R0,??DataTable86  ;; select_art
??MenuKeys3_16:
        MOV      R1,#+0
        B        ??MenuKeys3_10
//  249             }
//  250           }break;
//  251         case 2:
//  252           {
//  253             select_alb++;
??MenuKeys3_14:
        LDR      R0,??DataTable115  ;; select_alb
        LDR      R1,??DataTable115  ;; select_alb
        LDR      R1,[R1, #+0]
        ADD      R1,R1,#+1
        STR      R1,[R0, #+0]
//  254             if (select_alb==max_alb)
        MOV      R0,R1
        LDR      R1,??DataTable83  ;; max_alb
        LDR      R1,[R1, #+0]
        CMP      R0,R1
        BNE      ??MenuKeys3_3
//  255             {
//  256               select_alb=0;
        LDR      R0,??DataTable115  ;; select_alb
        B        ??MenuKeys3_16
//  257             }
//  258           }break;
//  259         case 3:
//  260           {
//  261             select_tra++;
??MenuKeys3_15:
        LDR      R0,??DataTable122  ;; select_tra
        LDR      R1,??DataTable122  ;; select_tra
        LDR      R1,[R1, #+0]
        ADD      R1,R1,#+1
        STR      R1,[R0, #+0]
//  262             if (select_tra==max_tra)
        MOV      R0,R1
        LDR      R1,??DataTable127  ;; max_tra
        LDR      R1,[R1, #+0]
        CMP      R0,R1
        BNE      ??MenuKeys3_3
//  263             {
//  264               select_tra=0;
        LDR      R0,??DataTable122  ;; select_tra
        MOV      R1,#+0
        B        ??MenuKeys3_10
//  265             }
//  266           }break;
//  267         }
//  268         REDRAW();
//  269       }break;
//  270     case ENTER_BUTTON:case'5':
//  271       if (ToView==1)
??MenuKeys3_17:
        LDR      R0,??DataTable131  ;; ToView
        LDR      R0,[R0, #+0]
        CMP      R0,#+1
        BNE      ??MenuKeys3_18
//  272       {
//  273         curent=0;
        LDR      R0,??DataTable147  ;; curent
        MOV      R1,#+0
        STR      R1,[R0, #+0]
//  274         char album[30];
//  275         for (int i=artists[select_art].i+2;i<artists[select_art+1].i;i++)
        LDR      R0,??DataTable86  ;; select_art
        LDR      R0,[R0, #+0]
        MOV      R1,#+36
        LDR      R2,??DataTable63  ;; artists
        MLA      R0,R1,R0,R2
        LDR      R0,[R0, #+32]
        ADD      R4,R0,#+2
        LDR      R0,??DataTable86  ;; select_art
        LDR      R0,[R0, #+0]
        MLA      R0,R1,R0,R2
        LDR      R0,[R0, #+68]
        CMP      R4,R0
        BGE      ??MenuKeys3_19
//  276         {
//  277           sprintf(album,pp);
??MenuKeys3_20:
        LDR      R1,??DataTable134  ;; pp
        ADD      R0,SP,#+4
        SWI      +22
        LDR      R0,??DataTable149  ;; masyv
        ADD      R5,R4,R0
        B        ??MenuKeys3_21
//  278           while ((masyv[i]!=0x0D)&&(i<artists[select_art+1].i))
//  279           {
//  280             sprintf(album,"%s%c",album,masyv[i]);
??MenuKeys3_22:
        LDRB     R3,[R5], #+1
        ADD      R2,SP,#+4
        LDR      R1,??DataTable139  ;; `?<Constant "%s%c">`
        ADD      R0,SP,#+4
        SWI      +22
//  281             i++;
        ADD      R4,R4,#+1
//  282           }
??MenuKeys3_21:
        LDRB     R0,[R5, #+0]
        CMP      R0,#+13
        BEQ      ??MenuKeys3_23
        LDR      R0,??DataTable86  ;; select_art
        LDR      R0,[R0, #+0]
        MOV      R1,#+36
        LDR      R2,??DataTable63  ;; artists
        MLA      R0,R1,R0,R2
        LDR      R0,[R0, #+68]
        CMP      R4,R0
        BLT      ??MenuKeys3_22
//  283         
//  284           if (strcmp(albums[curent-1].c,album))
??MenuKeys3_23:
        ADD      R1,SP,#+4
        LDR      R0,??DataTable147  ;; curent
        LDR      R0,[R0, #+0]
        MOV      R2,#+36
        LDR      R3,??DataTable116  ;; albums
        MLA      R0,R2,R0,R3
        SUB      R0,R0,#+36
        SWI      +25
        CMP      R0,#+0
        BEQ      ??MenuKeys3_24
//  285           {
//  286             sprintf(albums[curent].c,album);
        ADD      R1,SP,#+4
        LDR      R0,??DataTable147  ;; curent
        LDR      R0,[R0, #+0]
        MOV      R2,#+36
        LDR      R3,??DataTable116  ;; albums
        MLA      R0,R2,R0,R3
        SWI      +22
//  287             albums[curent].i=i;
        LDR      R0,??DataTable147  ;; curent
        LDR      R0,[R0, #+0]
        MOV      R1,#+36
        LDR      R2,??DataTable116  ;; albums
        MLA      R0,R1,R0,R2
        STR      R4,[R0, #+32]
//  288             curent++;
        LDR      R0,??DataTable147  ;; curent
        LDR      R1,??DataTable147  ;; curent
        LDR      R1,[R1, #+0]
        ADD      R1,R1,#+1
        STR      R1,[R0, #+0]
//  289           }
//  290           for (int j=0;j<3;j++)
??MenuKeys3_24:
        MOV      R0,#+3
        MOV      R2,#+36
        LDR      R3,??DataTable63  ;; artists
//  291           {
//  292             i++;
??MenuKeys3_25:
        ADD      R4,R4,#+1
//  293             while ((masyv[i]!=0x0D)&&(i<artists[select_art+1].i))
        LDR      R1,??DataTable149  ;; masyv
        LDRB     R1,[R4, +R1]
        CMP      R1,#+13
        BEQ      ??MenuKeys3_26
        LDR      R1,??DataTable86  ;; select_art
        LDR      R1,[R1, #+0]
        MLA      R1,R2,R1,R3
        LDR      R1,[R1, #+68]
        CMP      R4,R1
        BLT      ??MenuKeys3_25
//  294             {
//  295               i++;
//  296             }
//  297           }
??MenuKeys3_26:
        SUBS     R0,R0,#+1
        BNE      ??MenuKeys3_25
//  298           i++;
//  299         }
        ADD      R4,R4,#+2
        LDR      R0,??DataTable86  ;; select_art
        LDR      R0,[R0, #+0]
        MOV      R1,#+36
        LDR      R2,??DataTable63  ;; artists
        MLA      R0,R1,R0,R2
        LDR      R0,[R0, #+68]
        CMP      R4,R0
        BLT      ??MenuKeys3_20
//  300         max_alb=curent;
??MenuKeys3_19:
        LDR      R0,??DataTable83  ;; max_alb
        LDR      R1,??DataTable147  ;; curent
        LDR      R1,[R1, #+0]
        STR      R1,[R0, #+0]
//  301         albums[max_alb].i=artists[select_art+1].i;
        MOV      R0,R1
        MOV      R1,#+36
        LDR      R2,??DataTable116  ;; albums
        MLA      R0,R1,R0,R2
        LDR      R1,??DataTable86  ;; select_art
        LDR      R1,[R1, #+0]
        MOV      R2,#+36
        LDR      R3,??DataTable63  ;; artists
        MLA      R1,R2,R1,R3
        LDR      R1,[R1, #+68]
        STR      R1,[R0, #+32]
//  302         select_alb=0;
        LDR      R0,??DataTable115  ;; select_alb
        MOV      R1,#+0
        STR      R1,[R0, #+0]
//  303         ToView++;
        LDR      R0,??DataTable131  ;; ToView
        LDR      R1,??DataTable131  ;; ToView
        LDR      R1,[R1, #+0]
        ADD      R1,R1,#+1
        B        ??MenuKeys3_10
//  304         REDRAW();
//  305       }
//  306       else
//  307         if (ToView==2)
??MenuKeys3_18:
        LDR      R0,??DataTable131  ;; ToView
        LDR      R0,[R0, #+0]
        CMP      R0,#+2
        BNE      ??MenuKeys3_27
//  308       {
//  309         curent=0;
        LDR      R0,??DataTable147  ;; curent
        MOV      R1,#+0
        STR      R1,[R0, #+0]
//  310         char track[30];
//  311         for (int i=albums[select_alb].i+2;i<albums[select_alb+1].i;i++)
        LDR      R0,??DataTable115  ;; select_alb
        LDR      R0,[R0, #+0]
        MOV      R1,#+36
        LDR      R2,??DataTable116  ;; albums
        MLA      R0,R1,R0,R2
        LDR      R0,[R0, #+32]
        ADD      R4,R0,#+2
        LDR      R0,??DataTable115  ;; select_alb
        LDR      R0,[R0, #+0]
        MLA      R0,R1,R0,R2
        LDR      R0,[R0, #+68]
        CMP      R4,R0
        BGE      ??MenuKeys3_28
//  312         {
//  313           sprintf(track,pp);
??MenuKeys3_29:
        LDR      R1,??DataTable134  ;; pp
        ADD      R0,SP,#+4
        SWI      +22
        LDR      R0,??DataTable149  ;; masyv
        ADD      R5,R4,R0
        B        ??MenuKeys3_30
//  314           while ((masyv[i]!=0x0D)&&(i<albums[select_alb+1].i))
//  315           {
//  316             sprintf(track,"%s%c",track,masyv[i]);
??MenuKeys3_31:
        LDRB     R3,[R5], #+1
        ADD      R2,SP,#+4
        LDR      R1,??DataTable139  ;; `?<Constant "%s%c">`
        ADD      R0,SP,#+4
        SWI      +22
//  317             i++;
        ADD      R4,R4,#+1
//  318           }
??MenuKeys3_30:
        LDRB     R0,[R5, #+0]
        CMP      R0,#+13
        BEQ      ??MenuKeys3_32
        LDR      R0,??DataTable115  ;; select_alb
        LDR      R0,[R0, #+0]
        MOV      R1,#+36
        LDR      R2,??DataTable116  ;; albums
        MLA      R0,R1,R0,R2
        LDR      R0,[R0, #+68]
        CMP      R4,R0
        BLT      ??MenuKeys3_31
//  319         
//  320           //if (strcmp(tracks[curent-1].c,track))
//  321           {
//  322             sprintf(tracks[curent].c,track);
??MenuKeys3_32:
        ADD      R1,SP,#+4
        LDR      R0,??DataTable147  ;; curent
        LDR      R0,[R0, #+0]
        MOV      R2,#+36
        LDR      R3,??DataTable114  ;; tracks
        MLA      R0,R2,R0,R3
        SWI      +22
//  323             tracks[curent].i=i;
        LDR      R0,??DataTable147  ;; curent
        LDR      R0,[R0, #+0]
        MOV      R1,#+36
        LDR      R2,??DataTable114  ;; tracks
        MLA      R0,R1,R0,R2
        STR      R4,[R0, #+32]
//  324             curent++;
        LDR      R0,??DataTable147  ;; curent
        LDR      R1,??DataTable147  ;; curent
        LDR      R1,[R1, #+0]
        ADD      R1,R1,#+1
        STR      R1,[R0, #+0]
//  325           }
//  326           
//  327           for (int j=0;j<3;j++)
        MOV      R0,#+3
        MOV      R2,#+36
        LDR      R3,??DataTable116  ;; albums
//  328           {
//  329             i++;
??MenuKeys3_33:
        ADD      R4,R4,#+1
//  330             while ((masyv[i]!=0x0D)&&(i<albums[select_alb+1].i))
        LDR      R1,??DataTable149  ;; masyv
        LDRB     R1,[R4, +R1]
        CMP      R1,#+13
        BEQ      ??MenuKeys3_34
        LDR      R1,??DataTable115  ;; select_alb
        LDR      R1,[R1, #+0]
        MLA      R1,R2,R1,R3
        LDR      R1,[R1, #+68]
        CMP      R4,R1
        BLT      ??MenuKeys3_33
//  331             {
//  332               i++;
//  333             }
//  334           }
??MenuKeys3_34:
        SUBS     R0,R0,#+1
        BNE      ??MenuKeys3_33
//  335           i++;
//  336         }
        ADD      R4,R4,#+2
        LDR      R0,??DataTable115  ;; select_alb
        LDR      R0,[R0, #+0]
        MOV      R1,#+36
        LDR      R2,??DataTable116  ;; albums
        MLA      R0,R1,R0,R2
        LDR      R0,[R0, #+68]
        CMP      R4,R0
        BLT      ??MenuKeys3_29
//  337         max_tra=curent;
??MenuKeys3_28:
        LDR      R0,??DataTable127  ;; max_tra
        LDR      R1,??DataTable147  ;; curent
        LDR      R1,[R1, #+0]
        STR      R1,[R0, #+0]
//  338         tracks[max_tra].i=albums[select_alb+1].i;
        MOV      R0,R1
        MOV      R1,#+36
        LDR      R2,??DataTable114  ;; tracks
        MLA      R0,R1,R0,R2
        LDR      R1,??DataTable115  ;; select_alb
        LDR      R1,[R1, #+0]
        MOV      R2,#+36
        LDR      R3,??DataTable116  ;; albums
        MLA      R1,R2,R1,R3
        LDR      R1,[R1, #+68]
        STR      R1,[R0, #+32]
//  339         select_tra=0;
        LDR      R0,??DataTable122  ;; select_tra
        MOV      R1,#+0
        STR      R1,[R0, #+0]
//  340         ToView++;
        LDR      R0,??DataTable131  ;; ToView
        LDR      R1,??DataTable131  ;; ToView
        LDR      R1,[R1, #+0]
        ADD      R1,R1,#+1
        STR      R1,[R0, #+0]
//  341         REDRAW();
??MenuKeys3_3:
        SWI      +370
        MOV      R0,#+0
??MenuKeys3_4:
        ADD      SP,SP,#+804
        CFI CFA R13+20
        POP      {R4-R7,PC}
        CFI CFA R13+824
//  342       }
//  343       else
//  344         if (ToView==3)
??MenuKeys3_27:
        LDR      R0,??DataTable131  ;; ToView
        LDR      R0,[R0, #+0]
        CMP      R0,#+3
        BNE      ??MenuKeys3_1
//  345         {
//  346           char shliah[256];
//  347           int i=tracks[select_tra].i+2;
//  348           int f;
//  349           unsigned int err;
//  350           char way[256];
//  351           sprintf(way,"%smedia.ipl",playerfolder);
        LDR      R2,??DataTable132  ;; playerfolder
        LDR      R1,??MenuKeys3_35+0x4  ;; `?<Constant "%smedia.ipl">`
        ADD      R0,SP,#+548
        SWI      +22
//  352           if ((f=fopen(way, A_WriteOnly+A_Create, P_WRITE, & err ))!=-1)
        MOV      R3,SP
        MOV      R2,#+256
        ORR      R1,R2,#0x1
        ADD      R0,SP,#+548
        SWI      +10
        MOV      R4,R0
        CMN      R4,#+1
        BEQ      ??MenuKeys3_36
//  353           {          
//  354             sprintf(shliah,"%c%c%c\r\n",max_tra,1,select_tra);
        LDR      R0,??DataTable122  ;; select_tra
        LDR      R0,[R0, #+0]
        PUSH     {R0}
        CFI CFA R13+828
        MOV      R3,#+1
        LDR      R0,??DataTable127  ;; max_tra
        LDR      R2,[R0, #+0]
        LDR      R1,??MenuKeys3_35+0x8  ;; `?<Constant "%c%c%c\\r\\n">`
        ADD      R0,SP,#+296
        SWI      +22
//  355             fwrite(f,shliah,5,&err);
        ADD      R3,SP,#+4
        MOV      R2,#+5
        ADD      R1,SP,#+296
        MOV      R0,R4
        SWI      +12
//  356             for (i=0;i<max_tra;i++)
        MOV      R5,#+0
        LDR      R6,??MenuKeys3_35+0xC  ;; tracks + 32
        ADD      SP,SP,#+4        ;; stack cleaning
        CFI CFA R13+824
        B        ??MenuKeys3_37
//  357             {
//  358               int j=tracks[i].i+2;
//  359               sprintf(shliah,pp);
//  360               while ((masyv[j]!=0x0D)&&(j<tracks[i+1].i))
//  361               {
//  362                 sprintf(shliah,"%s%c",shliah,masyv[j]);
??MenuKeys3_38:
        LDR      R0,??DataTable149  ;; masyv
        LDRB     R3,[R7, +R0]
        ADD      R2,SP,#+292
        LDR      R1,??DataTable139  ;; `?<Constant "%s%c">`
        ADD      R0,SP,#+292
        SWI      +22
//  363                 j++;
        ADD      R7,R7,#+1
//  364               }
??MenuKeys3_39:
        LDR      R0,??DataTable149  ;; masyv
        LDRB     R0,[R7, +R0]
        CMP      R0,#+13
        BEQ      ??MenuKeys3_40
        LDR      R0,[R6, #+36]
        CMP      R7,R0
        BLT      ??MenuKeys3_38
//  365               char s[256]="";
??MenuKeys3_40:
        ADD      R0,SP,#+36
        MOV      R1,#+0
        MOV      R2,#+256
??MenuKeys3_41:
        SUBS     R2,R2,#+4
        STR      R1,[R0, R2]
        BNE      ??MenuKeys3_41
//  366               char *y=strrchr(shliah,'\\')+1;
        MOV      R1,#+92
        ADD      R0,SP,#+292
        SWI      +279
        ADD      R7,R0,#+1
//  367               strncpy(s,shliah,y-shliah);
        ADD      R0,SP,#+292
        SUB      R2,R7,R0
        ADD      R1,SP,#+292
        ADD      R0,SP,#+36
        SWI      +278
//  368               s[y-shliah]='\0';
        ADD      R0,SP,#+292
        SUB      R0,R7,R0
        ADD      R1,SP,#+36
        MOV      R2,#+0
        STRB     R2,[R0, +R1]
//  369               sprintf(y,"%s\r\n",y);
        MOV      R2,R7
        LDR      R1,??MenuKeys3_35+0x10  ;; `?<Constant "%s\\r\\n">`
        MOV      R0,R7
        SWI      +22
//  370               fwrite(f,s,strlen(s),&err);
        ADD      R0,SP,#+36
        SWI      +27
        MOV      R2,R0
        MOV      R3,SP
        ADD      R1,SP,#+36
        MOV      R0,R4
        SWI      +12
//  371               fwrite(f,"*",1,&err);
        MOV      R3,SP
        MOV      R2,#+1
        ADR      R1,??MenuKeys3_35  ;; "*"
        MOV      R0,R4
        SWI      +12
//  372               fwrite(f,y,strlen(y),&err);
        MOV      R0,R7
        SWI      +27
        MOV      R3,SP
        MOV      R2,R0
        MOV      R1,R7
        MOV      R0,R4
        SWI      +12
        ADD      R5,R5,#+1
        ADD      R6,R6,#+36
??MenuKeys3_37:
        LDR      R0,??DataTable127  ;; max_tra
        LDR      R0,[R0, #+0]
        CMP      R5,R0
        BGE      ??MenuKeys3_42
        LDR      R0,[R6, #+0]
        ADD      R7,R0,#+2
        LDR      R1,??DataTable134  ;; pp
        ADD      R0,SP,#+292
        SWI      +22
        B        ??MenuKeys3_39
//  373             }
//  374             sprintf(shliah,"%sivoplay.elf",playerfolder);
??MenuKeys3_42:
        LDR      R2,??DataTable132  ;; playerfolder
        LDR      R1,??MenuKeys3_35+0x14  ;; `?<Constant "%sivoplay.elf">`
        ADD      R0,SP,#+292
        SWI      +22
//  375             main(shliah,way);
        ADD      R1,SP,#+548
        ADD      R0,SP,#+292
        _BLF     main,??main??rA
        B        ??MenuKeys3_43
//  376             /*CLOSECURENTCSM();
//  377             WSHDR* w=AllocWS(128);
//  378             wsprintf(w,"%sivoplay.elf",playerfolder);
//  379             ExecuteFile(w,0,way);
//  380             FreeWS(w);*/
//  381           }
//  382           else
//  383           {
//  384             Message(LG_CANT_CREATE_FILE);
??MenuKeys3_36:
        LDR      R0,??MenuKeys3_35+0x18  ;; `?<Constant "\\315\\345 \\354\\356\\346\\363 \\361\\362`
        _BLF     Message,??Message??rA
//  385           }
//  386           fclose(f,&err);
??MenuKeys3_43:
        MOV      R1,SP
        MOV      R0,R4
        SWI      +13
//  387           
//  388           CloseMAINMENU();
        _BLF     CloseMAINMENU,??CloseMAINMENU??rA
//  389           GeneralFunc_flag1 (GUI2,1);
        MOV      R1,#+1
        LDR      R0,??DataTable138  ;; GUI2
        LDR      R0,[R0, #+0]
        SWI      +317
//  390           
//  391         }
//  392       break;
//  393     }
//  394   }
//  395   return(0);
??MenuKeys3_1:
        MOV      R0,#+0
        ADD      SP,SP,#+804      ;; stack cleaning
        CFI CFA R13+20
        POP      {R4-R7,PC}       ;; return
        DATA
??MenuKeys3_35:
        DC8      "*",+0,+0
        DC32     `?<Constant "%smedia.ipl">`
        DC32     `?<Constant "%c%c%c\\r\\n">`
        DC32     tracks + 32
        DC32     `?<Constant "%s\\r\\n">`
        DC32     `?<Constant "%sivoplay.elf">`
        DC32     `?<Constant "\\315\\345 \\354\\356\\346\\363 \\361\\362`
        CFI EndBlock cfiBlock3
//  396 }

        RSEG CODE:CODE:NOROOT(2)
        DATA
??DataTable63:
        DC32     artists

        RSEG CODE:CODE:NOROOT(2)
        DATA
??DataTable83:
        DC32     max_alb

        RSEG CODE:CODE:NOROOT(2)
        DATA
??DataTable86:
        DC32     select_art

        RSEG CODE:CODE:NOROOT(2)
        DATA
??DataTable114:
        DC32     tracks

        RSEG CODE:CODE:NOROOT(2)
        DATA
??DataTable115:
        DC32     select_alb

        RSEG CODE:CODE:NOROOT(2)
        DATA
??DataTable116:
        DC32     albums

        RSEG CODE:CODE:NOROOT(2)
        DATA
??DataTable122:
        DC32     select_tra

        RSEG CODE:CODE:NOROOT(2)
        DATA
??DataTable127:
        DC32     max_tra

        RSEG CODE:CODE:NOROOT(2)
        CFI Block cfiBlock4 Using cfiCommon0
        CFI NoFunction
        THUMB
??ViewFiles??rT:
        BX       PC
        Nop      
        CFI EndBlock cfiBlock4
        REQUIRE ViewFiles

        RSEG DATA_C:CONST:SORT:NOROOT(2)
//  397 const void * const gui_methods4[11]={
gui_methods4:
        DATA
        DC32 OnRedraw4, onCreate2, onClose2, onFocus2, onUnfocus2, MenuKeys3
        DC32 0H, kill_data, method, method, 0H
//  398   (void *)OnRedraw4,	//Redraw
//  399   (void *)onCreate2,	//Create
//  400   (void *)onClose2,	//Close
//  401   (void *)onFocus2,	//Focus
//  402   (void *)onUnfocus2,	//Unfocus
//  403   (void *)MenuKeys3,	//OnKey
//  404   0,
//  405   #ifdef NEWSGOLD
//  406   (void *)onDestroy,	//Destroy
//  407   #else
//  408   (void *)kill_data,	//Destroy
//  409   #endif
//  410   (void *)method,
//  411   (void *)method,
//  412   0
//  413 };
//  414 

        RSEG CODE:CODE:NOROOT(2)
        CFI Block cfiBlock5 Using cfiCommon1
        CFI Function ViewFiles
        ARM
//  415 int ViewFiles()
//  416 {
ViewFiles:
        PUSH     {R4-R6,LR}
        CFI ?RET Frame(CFA, -4)
        CFI R6 Frame(CFA, -8)
        CFI R5 Frame(CFA, -12)
        CFI R4 Frame(CFA, -16)
        CFI CFA R13+16
        SUB      SP,SP,#+796
        CFI CFA R13+812
//  417   ToView=1;
        LDR      R0,??DataTable131  ;; ToView
        MOV      R1,#+1
        STR      R1,[R0, #+0]
//  418   int f;
//  419   char artist[30];
//  420   unsigned int err;
//  421   char name[320];
//  422   sprintf(name,"%smediafiiles.txt",playerfolder);
        LDR      R2,??DataTable132  ;; playerfolder
        LDR      R1,??ViewFiles_0+0x4  ;; `?<Constant "%smediafiiles.txt">`
        ADD      R0,SP,#+476
        SWI      +22
//  423   f=fopen(name, A_ReadOnly, P_READ, & err );
        MOV      R3,SP
        MOV      R2,#+128
        MOV      R1,#+0
        ADD      R0,SP,#+476
        SWI      +10
        MOV      R4,R0
//  424   if (f!=-1)
        CMN      R4,#+1
        BEQ      ??ViewFiles_1
//  425   {
//  426   DIR_ENTRY de;
//  427   FindFirstFile(&de,name,&err);
        MOV      R2,SP
        ADD      R1,SP,#+476
        ADD      R0,SP,#+36
        SWI      +107
//  428   fread(f,masyv,de.file_size,&err);
        MOV      R3,SP
        LDR      R2,[SP, #+56]
        LDR      R1,??DataTable149  ;; masyv
        MOV      R0,R4
        SWI      +11
//  429   sprintf(artist,pp);
        LDR      R1,??DataTable134  ;; pp
        ADD      R0,SP,#+4
        SWI      +22
//  430   for (int i=0;i<de.file_size;i++)
        MOV      R5,#+0
        LDR      R0,[SP, #+56]
        CMP      R0,#+0
        BNE      ??ViewFiles_2
//  431   {
//  432     sprintf(artist,"");
//  433     while ((masyv[i]!=0x0D)&&(i<de.file_size))
//  434     {
//  435       sprintf(artist,"%s%c",artist,masyv[i]);
//  436       i++;
//  437     }
//  438     if (strcmp(artists[curent-1].c,artist))
//  439     {
//  440       sprintf(artists[curent].c,artist);
//  441       artists[curent].i=i;
//  442       curent++;
//  443     }
//  444     for (int j=0;j<3;j++)
//  445     {
//  446       i++;
//  447       while ((masyv[i]!=0x0D)&&(i<de.file_size))
//  448       {
//  449         i++;
//  450       }
//  451     }
//  452     i++;
//  453   }
//  454   max_art=curent;
??ViewFiles_3:
        LDR      R0,??DataTable135  ;; max_art
        LDR      R1,??DataTable147  ;; curent
        LDR      R1,[R1, #+0]
        STR      R1,[R0, #+0]
//  455   artists[max_art].i=de.file_size;
        MOV      R0,R1
        MOV      R1,#+36
        LDR      R2,??DataTable145  ;; artists
        MLA      R0,R1,R0,R2
        LDR      R1,[SP, #+56]
        STR      R1,[R0, #+32]
//  456   FindClose(&de,&err);
        MOV      R1,SP
        ADD      R0,SP,#+36
        SWI      +109
//  457   }
//  458   fclose(f,&err);
??ViewFiles_1:
        MOV      R1,SP
        MOV      R0,R4
        SWI      +13
//  459   MAIN_GUI *main_gui=malloc(sizeof(MAIN_GUI));
        MOV      R0,#+60
        SWI      +20
        MOV      R4,R0
//  460   zeromem(main_gui,sizeof(MAIN_GUI));
        MOV      R1,#+60
        SWI      +285
//  461   main_gui->gui.canvas=(void *)(&Canvas3);
        LDR      R0,??ViewFiles_0+0x8  ;; Canvas3
        STR      R0,[R4, #+0]
//  462   main_gui->gui.flag30=2;
        MOV      R0,#+2
        STR      R0,[R4, #+44]
//  463   main_gui->gui.methods=(void *)gui_methods4;
        LDR      R0,??ViewFiles_0+0xC  ;; gui_methods4
        STR      R0,[R4, #+4]
//  464   main_gui->gui.item_ll.data_mfree=(void (*)(void *))mfree_adr();
        SWI      +32789
        STR      R0,[R4, #+28]
//  465   GUI2=CreateGUI(main_gui);
        MOV      R0,R4
        SWI      +311
        LDR      R1,??DataTable138  ;; GUI2
        STR      R0,[R1, #+0]
//  466   return(0);
        MOV      R0,#+0
        ADD      SP,SP,#+796      ;; stack cleaning
        CFI CFA R13+16
        POP      {R4-R6,PC}       ;; return
        CFI CFA R13+812
??ViewFiles_4:
        LDRB     R3,[R6], #+1
        ADD      R2,SP,#+4
        LDR      R1,??DataTable139  ;; `?<Constant "%s%c">`
        ADD      R0,SP,#+4
        SWI      +22
        ADD      R5,R5,#+1
??ViewFiles_5:
        LDRB     R0,[R6, #+0]
        CMP      R0,#+13
        BEQ      ??ViewFiles_6
        LDR      R0,[SP, #+56]
        CMP      R5,R0
        BCC      ??ViewFiles_4
??ViewFiles_6:
        ADD      R1,SP,#+4
        LDR      R0,??DataTable147  ;; curent
        LDR      R0,[R0, #+0]
        MOV      R2,#+36
        LDR      R3,??DataTable145  ;; artists
        MLA      R0,R2,R0,R3
        SUB      R0,R0,#+36
        SWI      +25
        CMP      R0,#+0
        BEQ      ??ViewFiles_7
        ADD      R1,SP,#+4
        LDR      R0,??DataTable147  ;; curent
        LDR      R0,[R0, #+0]
        MOV      R2,#+36
        LDR      R3,??DataTable145  ;; artists
        MLA      R0,R2,R0,R3
        SWI      +22
        LDR      R0,??DataTable147  ;; curent
        LDR      R0,[R0, #+0]
        MOV      R1,#+36
        LDR      R2,??DataTable145  ;; artists
        MLA      R0,R1,R0,R2
        STR      R5,[R0, #+32]
        LDR      R0,??DataTable147  ;; curent
        LDR      R1,??DataTable147  ;; curent
        LDR      R1,[R1, #+0]
        ADD      R1,R1,#+1
        STR      R1,[R0, #+0]
??ViewFiles_7:
        MOV      R0,#+3
??ViewFiles_8:
        ADD      R5,R5,#+1
        LDR      R1,??DataTable149  ;; masyv
        LDRB     R1,[R5, +R1]
        CMP      R1,#+13
        BEQ      ??ViewFiles_9
        LDR      R1,[SP, #+56]
        CMP      R5,R1
        BCC      ??ViewFiles_8
??ViewFiles_9:
        SUBS     R0,R0,#+1
        BNE      ??ViewFiles_8
        ADD      R5,R5,#+2
??ViewFiles_2:
        LDR      R0,[SP, #+56]
        CMP      R5,R0
        BCS      ??ViewFiles_3
        ADR      R1,??ViewFiles_0  ;; ""
        ADD      R0,SP,#+4
        SWI      +22
        LDR      R0,??DataTable149  ;; masyv
        ADD      R6,R5,R0
        B        ??ViewFiles_5
        DATA
??ViewFiles_0:
        DC8      "",+0,+0,+0
        DC32     `?<Constant "%smediafiiles.txt">`
        DC32     Canvas3
        DC32     gui_methods4
        CFI EndBlock cfiBlock5
//  467 }

        RSEG CODE:CODE:NOROOT(2)
        DATA
??DataTable131:
        DC32     ToView

        RSEG CODE:CODE:NOROOT(2)
        DATA
??DataTable132:
        DC32     playerfolder

        RSEG CODE:CODE:NOROOT(2)
        DATA
??DataTable134:
        DC32     pp

        RSEG CODE:CODE:NOROOT(2)
        DATA
??DataTable135:
        DC32     max_art

        RSEG CODE:CODE:NOROOT(2)
        DATA
??DataTable138:
        DC32     GUI2

        RSEG CODE:CODE:NOROOT(2)
        DATA
??DataTable139:
        DC32     `?<Constant "%s%c">`

        RSEG CODE:CODE:NOROOT(2)
        DATA
??DataTable145:
        DC32     artists

        RSEG CODE:CODE:NOROOT(2)
        DATA
??DataTable147:
        DC32     curent

        RSEG CODE:CODE:NOROOT(2)
        DATA
??DataTable149:
        DC32     masyv

        RSEG CODE:CODE:NOROOT(2)
        CFI Block cfiBlock6 Using cfiCommon1
        CFI NoFunction
        ARM
??GetFon??rA:
        LDR      R12,??Subroutine3_0  ;; GetFon
        BX       R12
        DATA
??Subroutine3_0:
        DC32     GetFon
        CFI EndBlock cfiBlock6

        RSEG CODE:CODE:NOROOT(2)
        CFI Block cfiBlock7 Using cfiCommon1
        CFI NoFunction
        ARM
??GetKatalogfontcolour??rA:
        LDR      R12,??Subroutine4_0  ;; GetKatalogfontcolour
        BX       R12
        DATA
??Subroutine4_0:
        DC32     GetKatalogfontcolour
        CFI EndBlock cfiBlock7

        RSEG CODE:CODE:NOROOT(2)
        CFI Block cfiBlock8 Using cfiCommon1
        CFI NoFunction
        ARM
??GetKatalogbackgroundcolour??rA:
        LDR      R12,??Subroutine5_0  ;; GetKatalogbackgroundcolour
        BX       R12
        DATA
??Subroutine5_0:
        DC32     GetKatalogbackgroundcolour
        CFI EndBlock cfiBlock8

        RSEG CODE:CODE:NOROOT(2)
        CFI Block cfiBlock9 Using cfiCommon1
        CFI NoFunction
        ARM
??main??rA:
        LDR      R12,??Subroutine6_0  ;; main
        BX       R12
        DATA
??Subroutine6_0:
        DC32     main
        CFI EndBlock cfiBlock9

        RSEG CODE:CODE:NOROOT(2)
        CFI Block cfiBlock10 Using cfiCommon1
        CFI NoFunction
        ARM
??Message??rA:
        LDR      R12,??Subroutine7_0  ;; Message
        BX       R12
        DATA
??Subroutine7_0:
        DC32     Message
        CFI EndBlock cfiBlock10

        RSEG CODE:CODE:NOROOT(2)
        CFI Block cfiBlock11 Using cfiCommon1
        CFI NoFunction
        ARM
??CloseMAINMENU??rA:
        LDR      R12,??Subroutine8_0  ;; CloseMAINMENU
        BX       R12
        DATA
??Subroutine8_0:
        DC32     CloseMAINMENU
        CFI EndBlock cfiBlock11

        RSEG DATA_ID:CONST:SORT:NOROOT(2)
`?<Initializer for ToView>`:
        DATA
        DC32 1

        RSEG DATA_ID:CONST:SORT:NOROOT(2)
`?*?DATA_ID`:

        RSEG INITTAB:CODE:ROOT(2)
        DATA
?init?tab?DATA_I:
        DCD      sfe(DATA_I) - sfb(DATA_I), sfb(DATA_I), sfb(DATA_ID)

        RSEG INITTAB:CODE:ROOT(2)
        DATA
?init?tab?DATA_Z:
        DCD      sfe(DATA_Z) - sfb(DATA_Z), sfb(DATA_Z), sfb(DATA_Z)

        END
// 
//  4 664 bytes in segment CODE
//    439 bytes in segment DATA_C
//      4 bytes in segment DATA_I
//      4 bytes in segment DATA_ID
// 40 832 bytes in segment DATA_Z
//     24 bytes in segment INITTAB
// 
//  4 580 bytes of CODE  memory (+ 108 bytes shared)
//    443 bytes of CONST memory
// 40 836 bytes of DATA  memory
//
//Errors: none
//Warnings: none
