Subversion Repositories Kolibri OS

Rev

Rev 5868 | Rev 5891 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5868 Rev 5889
Line 48... Line 48...
48
 
48
 
Line 49... Line 49...
49
    mcall   18, 25, 2, -1, 1
49
    mcall   18, 25, 2, -1, 1
Line 50... Line -...
50
 
-
 
51
  ;; CHECK FOR PARAMS
50
 
-
 
51
  ;; CHECK FOR PARAMS
52
 
52
 
53
    cmpne   [@params], byte 0, parse
53
    mov     eax, @params
54
    mov     eax, @params
-
 
55
    mov     ebx, sz_std
-
 
56
  @@:
-
 
57
    mov     cl, [ebx]
-
 
58
    mov     [eax], cl
-
 
Line 59... Line 54...
59
    inc     eax
54
    cmpne   [@params], byte 0, @f
Line 60... Line 55...
60
    inc     ebx
55
    mov     eax, sz_std
61
    cmpne   [ebx - 1], byte 0, @b
-
 
62
 
-
 
63
  ;; TEXT
-
 
64
 
56
  @@:
65
 parse:
-
 
66
    mov     [text.lines], dword 1
-
 
67
    mov     [text.max_len], dword 1
-
 
68
 
-
 
69
    mov     eax, @params
-
 
70
    mov     ebx, text.buffer
-
 
71
    mov     edx, 0
-
 
72
    mov     esi, 0
-
 
73
 
-
 
74
    cmpne   [eax], byte "'", @f
-
 
75
    mov     dl, "'"
-
 
76
    mov     eax, @params + 1
-
 
77
    jmp     .text
-
 
78
 
-
 
79
  @@:
-
 
80
    cmpne   [eax], byte '"', .text
-
 
81
    mov     dl, '"'
-
 
82
    mov     eax, @params + 1
-
 
83
 
-
 
84
  .text:
-
 
85
    cmpe    [eax], dl, .text.end
-
 
86
    cmpe    [eax], byte 0, .text.end
-
 
87
    mov     cl, [eax]
-
 
88
 
-
 
89
    cmpe    cl, "\", .char
-
 
90
    cmpne   cl, 10, .copy
-
 
91
    cmple   esi, dword [text.max_len], @f
-
 
92
    mov     [text.max_len], esi
-
 
93
  @@:
-
 
94
    mov     esi, 0
-
 
95
    mov     cl, 0
-
 
96
    inc     dword [text.lines]
-
 
97
    jmp     .copy
-
 
98
 
-
 
99
  .char:
-
 
100
    cmpe    [eax + 1], byte "n", .newline
-
 
101
    cmpe    [eax + 1], dl, .quote
-
 
102
    jmp     .copy
-
 
103
 
-
 
104
  .newline:
-
 
105
    cmple   esi, dword [text.max_len], @f
-
 
106
    mov     [text.max_len], esi
-
 
107
  @@:
-
 
108
    mov     esi, 0
-
 
109
    mov     cl, 0
-
 
110
    inc     dword [text.lines]
-
 
111
    inc     eax
-
 
112
    jmp     .copy
-
 
113
 
-
 
114
  .quote:
-
 
115
    mov     cl, dl
-
 
116
    inc     eax
-
 
117
 
-
 
118
  .copy:
57
 
119
    mov     [ebx], cl
-
 
120
    inc     eax
-
 
121
    inc     ebx
-
 
122
    inc     esi
-
 
123
    jmp     .text
-
 
124
  .text.end:
-
 
125
 
-
 
126
    cmple   esi, dword [text.max_len], @f
-
 
127
    mov     [text.max_len], esi
-
 
128
  @@:
-
 
129
 
-
 
Line 130... Line 58...
130
    mov     [ebx], byte 0
58
  ;; TEXT
Line 131... Line 59...
131
 
59
 
132
    cmpge   [text.max_len], dword 25, @f
60
 parse:
Line 133... Line 61...
133
    mov     [text.max_len], dword 25
61
    mov     eax, sz_std
134
  @@:
62
    call    parse_text
135
 
63
 
-
 
64
 ;; PARAMS
Line 136... Line 65...
136
 ;; PARAMS
65
 
137
 
66
  .params:
138
  .params:
67
    mov     dl, [eax]
139
    mov     dl, [eax]
68
 
Line 158... Line 87...
158
 
87
 
159
  .set_title:
88
  .set_title:
160
    mov     [params.title], byte 1
89
    mov     [params.title], byte 1
Line -... Line 90...
-
 
90
    jmp     .next_char
-
 
91
 
-
 
92
  .set_ctrl:
-
 
93
    mov     [params.ctrl], byte 1
161
    jmp     .next_char
94
    jmp     .next_char
162
 
95
 
Line 163... Line 96...
163
  .set_icon:
96
  .set_icon:
164
    mov     [params.icon], ebx
97
    mov     [params.icon], ebx
Line 569... Line 502...
569
 
502
 
Line 570... Line 503...
570
    ret
503
    ret
Line -... Line 504...
-
 
504
 
-
 
505
 ;----------------------------
-
 
506
 
-
 
507
 parse_text:
-
 
508
    mov     dword [text.max_len], 0
-
 
509
    mov     dword [text.lines], 1
-
 
510
    mov     ebx, text.buffer
-
 
511
    mov     ecx, 0
-
 
512
    mov     dl, 0
-
 
513
    mov     dh, 0
-
 
514
 
-
 
515
    cmpne   byte [eax], "'", @f
-
 
516
    mov     dl, "'"
-
 
517
    mov     dh, 1
-
 
518
  @@:
-
 
519
    cmpne   byte [eax], '"', @f
-
 
520
    mov     dl, '"'
-
 
521
    mov     dh, 1
-
 
522
  @@:
-
 
523
    cmpne   dh, 1, @f
-
 
524
    inc     eax
-
 
525
  @@:
-
 
526
 
-
 
527
  .parse_loop:
-
 
528
    cmpe    byte [eax],  0, .parse_loop.end
-
 
529
    cmpe    byte [eax], dl, .parse_loop.end
-
 
530
    mov     dh, [eax]
-
 
531
 
-
 
532
    cmpe    byte [eax], 10, .newline
-
 
533
 
-
 
534
    cmpne   byte [eax + 0], "\", @f
-
 
535
    cmpne   byte [eax + 1], "n", @f
-
 
536
    inc     eax
-
 
537
 
-
 
538
  .newline:
-
 
539
    mov     byte [ebx], 0
-
 
540
    cmple   ecx, dword [text.max_len], .skip_max_len
-
 
541
    mov     dword [text.max_len], ecx
-
 
542
  .skip_max_len:
-
 
543
    mov     ecx, 0
-
 
544
    inc     dword [text.lines]
-
 
545
    jmp     .next
-
 
546
  @@:
-
 
547
 
-
 
548
    mov     [ebx], dh
-
 
549
 
-
 
550
  .next:
-
 
551
    inc     eax
-
 
552
    inc     ebx
-
 
553
    inc     ecx
-
 
554
    jmp     .parse_loop
-
 
555
  .parse_loop.end:
-
 
556
 
-
 
557
    cmple   ecx, dword [text.max_len], @f
-
 
558
    mov     dword [text.max_len], ecx
-
 
559
  @@:
-
 
560
 
-
 
561
    cmpge   [text.max_len], dword 25, @f
-
 
562
    mov     [text.max_len], dword 25
-
 
563
  @@:
-
 
564
 
-
 
565
    mov     [ebx], byte 0
-
 
566
 
-
 
567
    ret
571
 
568
 
572
 ;----------------------------
569
 ;----------------------------
573
 
570
 
574
 @imports:
571
 @imports:
575
    library img, "libimg.obj"
572
    library img, "libimg.obj"
Line 625... Line 622...
625
 
622
 
626
 params:
623
 params:
627
  .atcl     rb 1
624
  .atcl     rb 1
628
  .title    rb 1
625
  .title    rb 1
-
 
626
  .icon     rd 1
Line 629... Line 627...
629
  .icon     rd 1
627
  .ctrl     rb 1
630
 
628
 
631
 img_data:
629
 img_data: