Subversion Repositories Kolibri OS

Rev

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

Rev 7675 Rev 7677
Line 7... Line 7...
7
 
7
 
8
BLACK_ON_WHITE  = 0
8
BLACK_ON_WHITE  = 0
9
MOVIEOS         = 1
9
MOVIEOS         = 1
Line -... Line 10...
-
 
10
WHITE_ON_BLACK  = 2
-
 
11
 
-
 
12
;-----------------------------------------------------------------------------
-
 
13
;                                Font
-
 
14
 
-
 
15
FONT            equ 0           ; 0 to 3
-
 
16
FONT_MULTIPLIER equ 1           ; 1 to 8
-
 
17
 
-
 
18
;-----------------------------------------------------------------------------
-
 
19
;                       GUI elements size and position
-
 
20
 
-
 
21
TEXT_Y_CLEARANCE        = 1                                                     ; in pixels
-
 
22
 
-
 
23
DATA_WIDTH              = 80                                                    ; in characters
-
 
24
DATA_X_POS              = 12                                                    ; in pixels
-
 
25
 
-
 
26
TITLE_X_POS             = 30                                                    ; in pixels
-
 
27
TITLE_Y_POS             = 8                                                     ; in pixels
-
 
28
 
-
 
29
DUMP_HEIGHT             = 6                                                     ; in text lines
-
 
30
MIN_DISASM_HEIGHT       = 18                                                    ; in text lines
-
 
31
MSG_HEIGHT              = 14                                                    ; in text lines
-
 
32
 
-
 
33
;-----------------------------------------------------------------------------
-
 
34
 
-
 
35
if (FONT eq 0)
-
 
36
        FONT_X_SIZE     = 6*FONT_MULTIPLIER
-
 
37
else
-
 
38
        FONT_X_SIZE     = 8*FONT_MULTIPLIER
-
 
39
end if
-
 
40
 
-
 
41
if (FONT eq 0)
-
 
42
        FONT_Y_SIZE     = 9*FONT_MULTIPLIER
-
 
43
else
-
 
44
        FONT_Y_SIZE     = 16*FONT_MULTIPLIER
-
 
45
end if
-
 
46
 
-
 
47
TITLE_Y_SIZE            = (FONT_Y_SIZE + TEXT_Y_CLEARANCE)
-
 
48
DUMP_Y_POS              = (TITLE_Y_POS + TITLE_Y_SIZE)
-
 
49
DUMP_Y_SIZE             = (DUMP_HEIGHT*(FONT_Y_SIZE + TEXT_Y_CLEARANCE))
-
 
50
DISASM_Y_POS            = (DUMP_Y_POS + DUMP_Y_SIZE + 4)
-
 
51
 
-
 
52
MSG_WIDTH               = DATA_WIDTH
-
 
53
MSG_X_POS               = DATA_X_POS
-
 
54
MSG_X_SIZE              = MSG_WIDTH*FONT_X_SIZE
-
 
55
MSG_Y_SIZE              = MSG_HEIGHT*(FONT_Y_SIZE + TEXT_Y_CLEARANCE)
-
 
56
 
-
 
57
CMD_WIDTH               = DATA_WIDTH
-
 
58
CMD_X_POS               = DATA_X_POS
-
 
59
CMD_Y_SIZE              = (FONT_Y_SIZE+TEXT_Y_CLEARANCE)
-
 
60
 
-
 
61
REGISTERS_Y_POS         = DUMP_Y_POS
-
 
62
REGISTERS_X_SIZE        = (22+2)*(FONT_X_SIZE)                                  ; 22 characters + 2 spacing
-
 
63
 
-
 
64
wnd_x_size              = (DATA_X_POS + MSG_X_SIZE + DATA_X_POS + REGISTERS_X_SIZE + 3) + 10
-
 
65
wnd_y_size              = (((DISASM_Y_POS + (MIN_DISASM_HEIGHT*(FONT_Y_SIZE + TEXT_Y_CLEARANCE)) + 4) + MSG_Y_SIZE + 4) + CMD_Y_SIZE + DATA_X_POS)
-
 
66
 
10
WHITE_ON_BLACK  = 2
67
;-----------------------------------------------------------------------------
11
 
68
 
Line 12... Line 69...
12
;                         format - 0xRRGGBB
69
;                         format - 0xRRGGBB
13
if COLOR_THEME eq MOVIEOS
70
if COLOR_THEME eq MOVIEOS
Line 66... Line 123...
66
}
123
}
Line 67... Line 124...
67
 
124
 
68
 
-
 
69
 
-
 
70
;-----------------------------------------------------------------------------
-
 
71
 
-
 
72
data_width              = 80
-
 
73
data_x_pos              = 12
-
 
74
data_x_size             = data_width*6
-
 
75
 
-
 
76
title_x_pos             = 30
-
 
77
title_y_pos             = 8
-
 
78
title_y_size            = 10
-
 
79
 
-
 
80
dump_y_pos              = (title_y_pos + title_y_size)
-
 
81
dump_height             = 6
-
 
82
dump_y_size             = (dump_height*10)
-
 
83
 
-
 
84
disasm_y_pos            = (dump_y_pos + dump_y_size + 4)
-
 
85
min_disasm_height       = 18
-
 
86
min_disasm_y_size       = (min_disasm_height*10)
-
 
87
 
-
 
88
messages_width          = data_width
-
 
89
messages_height         = 8
-
 
90
messages_x_pos          = data_x_pos
-
 
91
min_messages_y_pos      = (disasm_y_pos + min_disasm_y_size + 4)
-
 
92
messages_x_size         = messages_width*6
-
 
93
messages_y_size         = messages_height*10
-
 
94
 
-
 
95
cmdline_width           = data_width
-
 
96
cmdline_x_pos           = data_x_pos
-
 
97
min_cmdline_y_pos       = (min_messages_y_pos + messages_y_size + 4)
-
 
98
cmdline_x_size          = messages_x_size
-
 
99
cmdline_y_size          = 10
-
 
100
 
-
 
101
registers_x_pos         = (data_x_pos + messages_x_size + 4)
-
 
102
registers_y_pos         = (title_y_pos + title_y_size - 3)
-
 
103
registers_x_size        = 134+2*6
-
 
104
registers_y_size        = (min_cmdline_y_pos + cmdline_y_size - registers_y_pos+1)
-
 
105
 
-
 
106
wnd_x_size              = (data_x_pos + messages_x_size + data_x_pos + registers_x_size+3) + 10
-
 
107
wnd_y_size              = (min_cmdline_y_pos + cmdline_y_size + data_x_pos)
125
 
Line 108... Line 126...
108
 
126
 
Line 109... Line 127...
109
;-----------------------------------------------------------------------------
127
;-----------------------------------------------------------------------------
Line 123... Line 141...
123
        push    eax
141
        push    eax
124
        fldcw   word [esp]
142
        fldcw   word [esp]
125
        pop     eax
143
        pop     eax
Line 126... Line 144...
126
 
144
 
127
        mov     edi, messages
145
        mov     edi, messages
128
        mov     ecx, messages_width*messages_height
146
        mov     ecx, MSG_WIDTH*MSG_HEIGHT
129
        mov     al, ' '
147
        mov     al, ' '
130
        rep stosb
148
        rep stosb
131
        xor     eax, eax
149
        xor     eax, eax
132
        mov     [messages_pos], eax
150
        mov     [messages_pos], eax
Line 136... Line 154...
136
        mov     ecx, (needzeroend-needzerostart+3)/4
154
        mov     ecx, (needzeroend-needzerostart+3)/4
137
        rep stosd
155
        rep stosd
138
        mov     esi, begin_str
156
        mov     esi, begin_str
139
        call    put_message_nodraw
157
        call    put_message_nodraw
140
        ; set event mask - default events and debugging events
158
        ; set event mask - default events and debugging events
141
        mcall   40, 0x107
159
        mcall   40, EVM_REDRAW or EVM_KEY or EVM_BUTTON or EVM_DEBUG
142
        ; set debug messages buffer
160
        ; set debug messages buffer
143
        mov     ecx, dbgbufsize
161
        mov     ecx, dbgbufsize
144
        mov     dword [ecx], 256
162
        mov     dword [ecx], 256
145
        xor     ebx, ebx
163
        xor     ebx, ebx
146
        mov     [ecx+4], ebx
164
        mov     [ecx+4], ebx
Line 190... Line 208...
190
        call    draw_fpu_regs
208
        call    draw_fpu_regs
191
.draw_label:
209
.draw_label:
192
        pop     edx
210
        pop     edx
193
        mov     edx, [btn2_tab+edx*4]
211
        mov     edx, [btn2_tab+edx*4]
194
        mov     edi, COLOR_BG_NORMAL
212
        mov     edi, COLOR_BG_NORMAL
195
        mov     ecx, (COLOR_TXT_NORMAL or 0x40000000)
213
        mov     ecx, ((FONT and 11b) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_NORMAL or 0x40000000)
196
        mov     esi, 7
214
        mov     esi, 7
197
        mov     ebx, [registers_x_pos_dd]
215
        mov     ebx, [registers_x_pos_dd]
198
        add     ebx, 4*10000h+registers_y_pos+2
216
        add     ebx, 4*10000h+REGISTERS_Y_POS
199
        mcall   4
217
        mcall   4
200
        jmp     waitevent
218
        jmp     waitevent
Line 201... Line 219...
201
 
219
 
202
align 4
220
align 4
Line 231... Line 249...
231
        jz      .up
249
        jz      .up
232
        cmp     ah, 0x41
250
        cmp     ah, 0x41
233
        jz      F7
251
        jz      F7
234
        cmp     ah, 0x42
252
        cmp     ah, 0x42
235
        jz      F8
253
        jz      F8
236
        cmp     [cmdline_len], cmdline_width
254
        cmp     [cmdline_len], CMD_WIDTH
237
        jae     waitevent
255
        jae     waitevent
238
        push    eax
256
        push    eax
239
        call    clear_cmdline_end
257
        call    clear_cmdline_end
240
        pop     eax
258
        pop     eax
241
        mov     edi, cmdline
259
        mov     edi, cmdline
Line 421... Line 439...
421
 
439
 
422
clear_cmdline_end:
440
clear_cmdline_end:
423
        mov     ebx, [cmdline_pos]
441
        mov     ebx, [cmdline_pos]
424
        mov     ecx, [cmdline_len]
442
        mov     ecx, [cmdline_len]
425
        sub     ecx, ebx
443
        sub     ecx, ebx
426
        imul    ebx, 6
444
        imul    ebx, FONT_X_SIZE
427
        imul    ecx, 6
445
        imul    ecx, FONT_X_SIZE
428
        inc     ecx
446
        inc     ecx
429
        add     ebx, cmdline_x_pos
447
        add     ebx, CMD_X_POS
430
        shl     ebx, 16
448
        shl     ebx, 16
431
        or      ebx, ecx
449
        or      ebx, ecx
432
        mov     ecx, [cmdline_y_pos_dd]
450
        mov     ecx, [cmdline_y_pos_dd]
433
        mov     cx, cmdline_y_size
451
        mov     cx, CMD_Y_SIZE
434
        mov     edx, COLOR_BG_NORMAL
452
        mov     edx, COLOR_BG_NORMAL
435
        ; draw container rectangle/box for cmdline
453
        ; draw container rectangle/box for cmdline
436
        mcall   13
454
        mcall   13
Line 446... Line 464...
446
 
464
 
447
    @@:
465
    @@:
448
        mov     esi, [cmdline_len]
466
        mov     esi, [cmdline_len]
Line 449... Line 467...
449
        sub     esi, ebx
467
        sub     esi, ebx
450
 
468
 
451
        mov     ecx, COLOR_TXT_NORMAL
469
        mov     ecx, (FONT and 11b) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_NORMAL
452
        lea     edx, [cmdline+ebx]
470
        lea     edx, [cmdline+ebx]
453
        imul    ebx, 6
471
        imul    ebx, FONT_X_SIZE
454
        add     ebx, cmdline_x_pos
472
        add     ebx, CMD_X_POS
455
        shl     ebx, 16
473
        shl     ebx, 16
456
        mov     bx, word[cmdline_y_pos_dd+4]
474
        mov     bx, word[cmdline_y_pos_dd+4]
457
        inc     bx
475
        inc     bx
Line 485... Line 503...
485
        inc     edx
503
        inc     edx
486
        jmp     .l
504
        jmp     .l
Line 487... Line 505...
487
 
505
 
488
    .newline:
506
    .newline:
489
        push    edx
507
        push    edx
490
        mov     ecx, messages_width
508
        mov     ecx, MSG_WIDTH
491
        xor     eax, eax
509
        xor     eax, eax
492
        xchg    eax, edx
510
        xchg    eax, edx
493
        div     ecx
511
        div     ecx
494
        xchg    eax, edx
512
        xchg    eax, edx
Line 531... Line 549...
531
        sub     ecx, 4
549
        sub     ecx, 4
532
        jns     .writenibble
550
        jns     .writenibble
533
        jmp     .l
551
        jmp     .l
Line 534... Line 552...
534
 
552
 
535
test_scroll:
553
test_scroll:
536
        cmp     edx, messages_width*messages_height
554
        cmp     edx, MSG_WIDTH*MSG_HEIGHT
537
        jnz     .ret
555
        jnz     .ret
538
        push    esi
556
        push    esi
539
        mov     edi, messages
557
        mov     edi, messages
540
        lea     esi, [edi+messages_width]
558
        lea     esi, [edi+MSG_WIDTH]
541
        mov     ecx, (messages_height-1)*messages_width/4
559
        mov     ecx, (MSG_HEIGHT-1)*MSG_WIDTH/4
542
        rep movsd
560
        rep movsd
543
        push    eax
561
        push    eax
544
        mov     al, ' '
562
        mov     al, ' '
545
        push    edi
563
        push    edi
546
        push    messages_width
564
        push    MSG_WIDTH
547
        pop     ecx
565
        pop     ecx
548
        sub     edx, ecx
566
        sub     edx, ecx
549
        rep stosb
567
        rep stosb
550
        pop     edi
568
        pop     edi
Line 559... Line 577...
559
put_message:
577
put_message:
560
        call    put_message_nodraw
578
        call    put_message_nodraw
Line 561... Line 579...
561
 
579
 
562
draw_messages:
580
draw_messages:
563
        ; draw container rectangle/box
581
        ; draw container rectangle/box
564
        mov     ebx, messages_x_pos shl 16
582
        mov     ebx, MSG_X_POS shl 16
565
        add     ebx, [messages_x_size_dd+4]
583
        add     ebx, [messages_x_size_dd+4]
566
        mov     ecx, [messages_y_pos_dd]
584
        mov     ecx, [messages_y_pos_dd]
567
        mov     cx, messages_y_size
585
        mov     cx, MSG_Y_SIZE
568
        mcall   13, , , COLOR_BG_NORMAL
586
        mcall   13, , , COLOR_BG_NORMAL
569
        mov     edx, messages
587
        mov     edx, messages
570
        push    messages_width
588
        push    MSG_WIDTH
571
        pop     esi
589
        pop     esi
572
        mov     ecx, COLOR_TXT_NORMAL
590
        mov     ecx, (FONT and 11b) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_NORMAL
573
        mov     ebx, messages_x_pos*10000h
591
        mov     ebx, MSG_X_POS*10000h
Line 574... Line 592...
574
        mov     bx, word[messages_y_pos_dd+4]
592
        mov     bx, word[messages_y_pos_dd+4]
575
 
593
 
576
    @@:
594
    @@:
577
        ; display text string in the window
595
        ; display text string in the window
578
        mcall   4
596
        mcall   4
579
        add     edx, esi
597
        add     edx, esi
580
        add     ebx, 10
598
        add     ebx, FONT_Y_SIZE+TEXT_Y_CLEARANCE
581
        cmp     edx, messages+messages_width*messages_height
599
        cmp     edx, messages+MSG_WIDTH*MSG_HEIGHT
Line 582... Line 600...
582
        jb      @b
600
        jb      @b
583
        ret
601
        ret
Line 584... Line 602...
584
 
602
 
585
;-----------------------------------------------------------------------------
603
;-----------------------------------------------------------------------------
586
;                     Show/hide cursor in command line
604
;                     Show/hide cursor in command line
587
 
605
 
588
; TODO: make it cursor.draw and cursor.hide ???
606
; TODO: make it cursor.draw and cursor.hide ???
589
draw_cursor:
607
draw_cursor:
590
        mov     ecx, [cmdline_y_pos_dd+2]
608
        mov     ecx, [cmdline_y_pos_dd+2]
591
        add     cx, cmdline_y_size-1
609
        add     cx, CMD_Y_SIZE-1
592
        mov     ebx, [cmdline_pos]
610
        mov     ebx, [cmdline_pos]
593
        imul    ebx, 6
611
        imul    ebx, FONT_X_SIZE
594
        add     ebx, cmdline_x_pos
612
        add     ebx, CMD_X_POS
595
        mov     edx, ebx
613
        mov     edx, ebx
596
        shl     ebx, 16
614
        shl     ebx, 16
597
        or      ebx, edx
615
        or      ebx, edx
Line 598... Line 616...
598
        mov     edx, COLOR_TXT_NORMAL
616
        mov     edx, (FONT and 11b) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_NORMAL
599
        ; draw line
617
        ; draw line
600
        mcall   38
618
        mcall   38
601
        ret
619
        ret
602
 
620
 
603
hide_cursor:
621
hide_cursor:
604
        mov     ebx, [cmdline_pos]
622
        mov     ebx, [cmdline_pos]
605
        imul    ebx, 6
623
        imul    ebx, FONT_X_SIZE
606
        add     ebx, cmdline_x_pos
624
        add     ebx, CMD_X_POS
607
        shl     ebx, 16
625
        shl     ebx, 16
608
        inc     ebx
626
        inc     ebx
609
        mov     ecx, [cmdline_y_pos_dd]
627
        mov     ecx, [cmdline_y_pos_dd]
610
        mov     cx, cmdline_y_size
628
        mov     cx, CMD_Y_SIZE
611
        mov     edx, COLOR_BG_NORMAL
629
        mov     edx, COLOR_BG_NORMAL
612
        ; draw container rectangle/box
630
        ; draw container rectangle/box
613
        mcall   13
631
        mcall   13
614
        mov     ebx, [cmdline_pos]
632
        mov     ebx, [cmdline_pos]
615
        cmp     ebx, [cmdline_len]
633
        cmp     ebx, [cmdline_len]
616
        jae     .ret
634
        jae     .ret
617
        ; setting up text color scheme and attributes
635
        ; setting up text color scheme and attributes
618
        mov     ecx, COLOR_TXT_NORMAL
636
        mov     ecx, (FONT and 11b) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_NORMAL
619
        lea     edx, [cmdline+ebx]
637
        lea     edx, [cmdline+ebx]
620
        imul    ebx, 6
638
        imul    ebx, FONT_X_SIZE
621
        add     ebx, cmdline_x_pos
639
        add     ebx, CMD_X_POS
Line 635... Line 653...
635
 
653
 
636
; FIXME: something wrong here
654
; FIXME: something wrong here
637
redraw_title:
655
redraw_title:
638
        ; draw container rectangle/box
656
        ; draw container rectangle/box
639
        mov     ebx, [data_x_size_dd+4]
657
        mov     ebx, [data_x_size_dd+4]
640
        add     ebx, title_x_pos*10000h+data_x_pos-title_x_pos
658
        add     ebx, TITLE_X_POS*10000h+DATA_X_POS-TITLE_X_POS
Line 641... Line 659...
641
        mcall   13, , title_y_pos*10000h+title_y_size, COLOR_BG_NORMAL
659
        mcall   13, , TITLE_Y_POS*10000h+TITLE_Y_SIZE, COLOR_BG_NORMAL
642
 
660
 
643
draw_title:
661
draw_title:
644
        mcall   38, (data_x_pos-2)*10000h+title_x_pos-5, (title_y_pos+5)*10001h, COLOR_LINE
662
        mcall   38, (DATA_X_POS-2)*10000h+TITLE_X_POS-5, (TITLE_Y_POS+(FONT_Y_SIZE/2))*10001h, COLOR_LINE
645
        push    NoPrgLoaded_len
663
        push    NoPrgLoaded_len
646
        pop     esi
664
        pop     esi
647
        cmp     [debuggee_pid], 0
665
        cmp     [debuggee_pid], 0
Line 648... Line 666...
648
        jz      @f
666
        jz      @f
649
        mov     esi, [prgname_len]
667
        mov     esi, [prgname_len]
650
 
668
 
651
    @@:
669
    @@:
652
        imul    ebx, esi, 6
670
        imul    ebx, esi, FONT_X_SIZE
653
        add     ebx, title_x_pos+4
671
        add     ebx, TITLE_X_POS+4
654
        shl     ebx, 16
672
        shl     ebx, 16
655
        mov     bx, data_x_pos-10-5-6*7
673
        mov     bx, DATA_X_POS-10-5-FONT_X_SIZE*7
656
        add     bx, word[data_x_size_dd+4]
674
        add     bx, word[data_x_size_dd+4]
Line 657... Line 675...
657
        cmp     [bSuspended], 0
675
        cmp     [bSuspended], 0
658
        jz      @f
676
        jz      @f
659
        add     ebx, 6
677
        add     ebx, FONT_X_SIZE
660
 
678
 
661
    @@:
679
    @@:
662
        ; draw line with COLOR_LINE (in edx)
680
        ; draw line with COLOR_LINE (in edx)
663
        mcall
681
        mcall
664
        mov     ebx, [data_x_size_dd+2]
682
        mov     ebx, [data_x_size_dd+2]
665
        add     ebx, (data_x_pos-10+4)*0x10000 + data_x_pos+2
683
        add     ebx, (DATA_X_POS-10+4)*0x10000 + DATA_X_POS+2
666
        ; draw line with COLOR_LINE (in edx)
684
        ; draw line with COLOR_LINE (in edx)
667
        mcall
685
        mcall
668
        mov     al, 4
686
        mov     al, 4
669
        mov     ebx, title_x_pos*10000h+title_y_pos
687
        mov     ebx, TITLE_X_POS*10000h+TITLE_Y_POS
670
        ; setting up text color scheme and attributes
688
        ; setting up text color scheme and attributes
671
        mov     ecx, COLOR_TXT_NORMAL
689
        mov     ecx, (FONT and 11b) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_NORMAL
Line 678... Line 696...
678
        ; draw text string in the window
696
        ; draw text string in the window
679
        mcall
697
        mcall
680
        cmp     [debuggee_pid], 0
698
        cmp     [debuggee_pid], 0
681
        jz      .nodebuggee
699
        jz      .nodebuggee
682
        mov     ebx, [data_x_size_dd]
700
        mov     ebx, [data_x_size_dd]
683
        add     ebx, (data_x_pos-10-6*7)*10000h + title_y_pos
701
        add     ebx, (DATA_X_POS-10-FONT_X_SIZE*7)*10000h + TITLE_Y_POS
684
        mov     edx, aRunning
702
        mov     edx, aRunning
685
        push    7
703
        push    7
686
        pop     esi
704
        pop     esi
687
        cmp     [bSuspended], 0
705
        cmp     [bSuspended], 0
688
        jz      @f
706
        jz      @f
689
        add     ebx, 6*10000h
707
        add     ebx, FONT_X_SIZE*10000h
690
        mov     edx, aPaused
708
        mov     edx, aPaused
691
        dec     esi
709
        dec     esi
Line 692... Line 710...
692
 
710
 
693
    @@:
711
    @@:
694
        ; draw line with COLOR_LINE (in edx) in one case
712
        ; draw line with COLOR_LINE (in edx) in one case
695
        ; and draw text string with color COLOR_TXT_NORMAL (in ecx) in another
713
        ; and draw text string with color (FONT and 11b) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_NORMAL (in ecx) in another
696
        mcall
714
        mcall
Line 697... Line 715...
697
        ret
715
        ret
698
 
716
 
699
    .nodebuggee:
717
    .nodebuggee:
700
        mov     al, 38
718
        mov     al, 38
701
        mov     ebx, [data_x_size_dd+2]
719
        mov     ebx, [data_x_size_dd+2]
702
        add     ebx, (data_x_pos-10-6*7-5)*0x10000 + data_x_pos+2
720
        add     ebx, (DATA_X_POS-10-FONT_X_SIZE*7-5)*0x10000 + DATA_X_POS+2
703
        mov     ecx, (title_y_pos+5)*10001h
721
        mov     ecx, (TITLE_Y_POS+(FONT_Y_SIZE/2))*10001h
Line 704... Line 722...
704
        mov     edx, COLOR_LINE
722
        mov     edx, COLOR_LINE
705
        jmp     @b
723
        jmp     @b
Line 722... Line 740...
722
 
740
 
Line 723... Line 741...
723
        mov     ebp, ecx
741
        mov     ebp, ecx
Line 724... Line 742...
724
 
742
 
725
        mov     eax, [esi]
743
        mov     eax, [esi]
726
 
744
 
727
        mov     ecx, (COLOR_TXT_INACTIVE or 0x40000000)
745
        mov     ecx, ((FONT and 11b) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_INACTIVE or 0x40000000)
728
        cmp     [debuggee_pid], 0
746
        cmp     [debuggee_pid], 0
Line 729... Line 747...
729
        jz      .cd
747
        jz      .cd
730
        cmp     [bSuspended], 0
748
        cmp     [bSuspended], 0
731
        jz      .cd
749
        jz      .cd
732
 
750
 
733
        mov     ecx, (COLOR_TXT_NORMAL or 0x40000000)
751
        mov     ecx, ((FONT and 11b) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_NORMAL or 0x40000000)
734
        cmp     eax, dword [esi+oldcontext-context]
752
        cmp     eax, dword [esi+oldcontext-context]
Line 735... Line 753...
735
        je      .cd
753
        je      .cd
736
        mov     ecx, (COLOR_TXT_CHANGED or 0x40000000)
754
        mov     ecx, ((FONT and 11b) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_CHANGED or 0x40000000)
737
.cd:
755
.cd:
Line 738... Line 756...
738
        push    eax                       ;store reg value
756
        push    eax                       ;store reg value
739
 
757
 
740
        mov     esi, ebp
758
        mov     esi, ebp
741
        ; draw a text string in the window
759
        ; draw a text string in the window
Line 742... Line 760...
742
        mcall   4
760
        mcall   4
743
 
761
 
744
        imul    esi, 60000h
762
        imul    esi, FONT_X_SIZE*10000h
Line 745... Line 763...
745
        lea     edx, [ebx+esi]
763
        lea     edx, [ebx+esi]
746
        mov     esi, ecx
764
        mov     esi, ecx
747
        pop     ecx
765
        pop     ecx
Line 748... Line 766...
748
 
766
 
749
        ; draw a number in the window
767
        ; draw a number in the window
750
        rol     ecx, 16
768
        rol     ecx, 16
Line 1005... Line 1023...
1005
        shl     dx,4
1023
        shl     dx,4
1006
        loop    .w_exp
1024
        loop    .w_exp
Line 1007... Line 1025...
1007
 
1025
 
Line 1008... Line 1026...
1008
.display:
1026
.display:
1009
 
1027
 
1010
        mov     ecx, (COLOR_TXT_INACTIVE or 0x40000000)
1028
        mov     ecx, ((FONT and 11b) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_INACTIVE or 0x40000000)
1011
        cmp     [debuggee_pid], 0
1029
        cmp     [debuggee_pid], 0
1012
        jz      .do_label
1030
        jz      .do_label
Line 1013... Line 1031...
1013
        cmp     [bSuspended], 0
1031
        cmp     [bSuspended], 0
Line 1014... Line 1032...
1014
        jz      .do_label
1032
        jz      .do_label
1015
 
1033
 
1016
        mov     ecx, (COLOR_TXT_NORMAL or 0x40000000)
1034
        mov     ecx, ((FONT and 11b) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_NORMAL or 0x40000000)
Line 1026... Line 1044...
1026
        mov     ax, word [_st0+ebp+8]
1044
        mov     ax, word [_st0+ebp+8]
1027
        cmp     ax, word [_st0+(oldcontext-context)+ebp+8]
1045
        cmp     ax, word [_st0+(oldcontext-context)+ebp+8]
1028
        je      .do_label
1046
        je      .do_label
Line 1029... Line 1047...
1029
 
1047
 
1030
.scol:
1048
.scol:
Line 1031... Line 1049...
1031
        mov     ecx, (COLOR_TXT_CHANGED or 0x40000000)
1049
        mov     ecx, ((FONT and 11b) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_CHANGED or 0x40000000)
1032
 
1050
 
1033
.do_label:
-
 
1034
        ; draw a text string in the window
-
 
1035
 
1051
.do_label:
1036
        mov     eax, 4
1052
        ; draw a text string in the window
1037
        mov     esi, 23
1053
        mov     esi, 23
1038
        mov     edx, .str_buf
1054
        mov     edx, .str_buf
Line 1039... Line 1055...
1039
        mov     edi, COLOR_BG_NORMAL
1055
        mov     edi, COLOR_BG_NORMAL
1040
        int     0x40
1056
        mcall   4
Line 1041... Line 1057...
1041
 
1057
 
Line 1073... Line 1089...
1073
        call    .hex_2_str
1089
        call    .hex_2_str
1074
        mov     al, ' '
1090
        mov     al, ' '
1075
        stosb
1091
        stosb
1076
        call    .hex_2_str
1092
        call    .hex_2_str
Line 1077... Line 1093...
1077
 
1093
 
1078
        mov     ecx, (COLOR_TXT_INACTIVE or 0x40000000)
1094
        mov     ecx, ((FONT and 11b) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_INACTIVE or 0x40000000)
1079
        cmp     [debuggee_pid], 0
1095
        cmp     [debuggee_pid], 0
1080
        jz      .cd
1096
        jz      .cd
1081
        cmp     [bSuspended], 0
1097
        cmp     [bSuspended], 0
Line 1082... Line 1098...
1082
        jz      .cd
1098
        jz      .cd
Line 1083... Line 1099...
1083
 
1099
 
1084
        mov     ecx, (COLOR_TXT_NORMAL or 0x40000000)
1100
        mov     ecx, ((FONT and 11b) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_NORMAL or 0x40000000)
1085
 
1101
 
Line 1086... Line 1102...
1086
        mov     eax, dword [_mm0+ebp]
1102
        mov     eax, dword [_mm0+ebp]
1087
        cmp     eax, dword [_mm0+(oldcontext-context)+ebp]
1103
        cmp     eax, dword [_mm0+(oldcontext-context)+ebp]
1088
        jne     .scol
1104
        jne     .scol
Line 1089... Line 1105...
1089
 
1105
 
1090
        mov     eax, dword [_mm0+ebp+4]
1106
        mov     eax, dword [_mm0+ebp+4]
1091
        cmp     eax, dword [_mm0+(oldcontext-context)+ebp+4]
1107
        cmp     eax, dword [_mm0+(oldcontext-context)+ebp+4]
1092
        je     .cd
1108
        je     .cd
Line 1093... Line -...
1093
 
-
 
1094
.scol:
1109
 
1095
        mov     ecx, (COLOR_TXT_CHANGED or 0x40000000)
1110
.scol:
1096
.cd:
1111
        mov     ecx, ((FONT and 11b) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_CHANGED or 0x40000000)
1097
        ; draw a text string in the window
1112
.cd:
1098
 
1113
        ; draw a text string in the window
1099
        mov     eax, 4
1114
 
1100
        mov     esi, 23
1115
        mov     esi, 23
Line 1101... Line 1116...
1101
        mov     edx, esp
1116
        mov     edx, esp
Line 1123... Line 1138...
1123
draw_fpu_regs:
1138
draw_fpu_regs:
1124
        push    ebp
1139
        push    ebp
1125
        push    8
1140
        push    8
1126
        xor     ebp, ebp
1141
        xor     ebp, ebp
1127
        mov     ebx, [registers_x_pos_dd]
1142
        mov     ebx, [registers_x_pos_dd]
1128
        add     ebx, 2*10000h+registers_y_pos+142
1143
        add     ebx, 2*10000h+REGISTERS_Y_POS+14*(TEXT_Y_CLEARANCE+FONT_Y_SIZE)
1129
.draw_regs:
1144
.draw_regs:
1130
        call    draw_fpu_register_2
1145
        call    draw_fpu_register_2
1131
        add     ebx, 10
1146
        add     ebx, FONT_Y_SIZE+TEXT_Y_CLEARANCE
1132
        inc     ebp
1147
        inc     ebp
1133
        dec     dword [esp]
1148
        dec     dword [esp]
1134
        jnz     .draw_regs
1149
        jnz     .draw_regs
1135
        pop     eax                         ;restore stack
1150
        pop     eax                         ;restore stack
1136
        pop     ebp
1151
        pop     ebp
Line 1140... Line 1155...
1140
draw_mmx_regs:
1155
draw_mmx_regs:
1141
        push    ebp
1156
        push    ebp
1142
        push    8
1157
        push    8
1143
        xor     ebp, ebp
1158
        xor     ebp, ebp
1144
        mov     ebx, [registers_x_pos_dd]
1159
        mov     ebx, [registers_x_pos_dd]
1145
        add     ebx, 2*10000h+registers_y_pos+142
1160
        add     ebx, 2*10000h+REGISTERS_Y_POS+14*(TEXT_Y_CLEARANCE+FONT_Y_SIZE)
1146
.draw_regs:
1161
.draw_regs:
1147
        call    draw_mmx_register_2
1162
        call    draw_mmx_register_2
1148
        add     ebx, 10
1163
        add     ebx, FONT_Y_SIZE+TEXT_Y_CLEARANCE
1149
        inc     ebp
1164
        inc     ebp
1150
        dec     dword [esp]
1165
        dec     dword [esp]
1151
        jnz     .draw_regs
1166
        jnz     .draw_regs
1152
        pop     eax
1167
        pop     eax
1153
        pop     ebp
1168
        pop     ebp
Line 1157... Line 1172...
1157
draw_sse_regs:
1172
draw_sse_regs:
1158
        push    ebp
1173
        push    ebp
1159
        push    8
1174
        push    8
1160
        xor     ebp, ebp
1175
        xor     ebp, ebp
1161
        mov     ebx, [registers_x_pos_dd]
1176
        mov     ebx, [registers_x_pos_dd]
1162
        add     ebx, 2*10000h+registers_y_pos+232
1177
        add     ebx, 2*10000h+REGISTERS_Y_POS+14*(TEXT_Y_CLEARANCE+FONT_Y_SIZE)
1163
.draw_regs:
1178
.draw_regs:
1164
     ;   call    draw_sse_register
1179
     ;   call    draw_sse_register
1165
        add     ebx, 10
1180
        add     ebx, FONT_Y_SIZE+TEXT_Y_CLEARANCE
1166
        inc     ebp
1181
        inc     ebp
1167
        dec     dword [esp]
1182
        dec     dword [esp]
1168
        jnz     .draw_regs
1183
        jnz     .draw_regs
1169
        pop     eax
1184
        pop     eax
1170
        pop     ebp
1185
        pop     ebp
Line 1183... Line 1198...
1183
 
1198
 
1184
    .on:
1199
    .on:
Line 1185... Line 1200...
1185
        and     byte [edx], not 20h
1200
        and     byte [edx], not 20h
1186
 
1201
 
1187
    .onoff:
1202
    .onoff:
1188
        mov     ecx, (COLOR_TXT_INACTIVE or 0x40000000)
1203
        mov     ecx, ((FONT and 11b) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_INACTIVE or 0x40000000)
1189
        cmp     [debuggee_pid], 0
1204
        cmp     [debuggee_pid], 0
1190
        jz      .doit
1205
        jz      .doit
Line 1191... Line 1206...
1191
        cmp     [bSuspended], 0
1206
        cmp     [bSuspended], 0
1192
        jz      .doit
1207
        jz      .doit
1193
 
1208
 
1194
        mov     ecx, (COLOR_TXT_NORMAL or 0x40000000)
1209
        mov     ecx, ((FONT and 11b) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_NORMAL or 0x40000000)
1195
        bt      [_eflags], edi
1210
        bt      [_eflags], edi
1196
        lahf
1211
        lahf
1197
        bt      dword [_eflags + oldcontext - context], edi
1212
        bt      dword [_eflags + oldcontext - context], edi
1198
        rcl     ah, 1
1213
        rcl     ah, 1
Line 1199... Line 1214...
1199
        test    ah, 3
1214
        test    ah, 3
1200
        jp      .doit
1215
        jp      .doit
1201
        mov     ecx, (COLOR_TXT_CHANGED or 0x40000000)
1216
        mov     ecx, ((FONT and 11b) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_CHANGED or 0x40000000)
1202
 
1217
 
Line 1213... Line 1228...
1213
;                      Draw registers frame title
1228
;                      Draw registers frame title
Line 1214... Line 1229...
1214
 
1229
 
1215
; Also show current register set (common + MMX, SSE or AVX)
1230
; Also show current register set (common + MMX, SSE or AVX)
1216
draw_reg_title:
1231
draw_reg_title:
1217
        mov     edi, COLOR_BG_NORMAL
1232
        mov     edi, COLOR_BG_NORMAL
1218
        mov     ecx, (COLOR_TXT_NORMAL or 0x40000000)
1233
        mov     ecx, ((FONT and 11b) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_NORMAL or 0x40000000)
1219
        mov     esi, 7
1234
        mov     esi, 7
1220
        cmp     [reg_mode], REG_MODE_CPU
1235
        cmp     [reg_mode], REG_MODE_CPU
1221
        jz      @f
1236
        jz      @f
1222
        mov     ecx, (COLOR_TXT_INACTIVE or 0x40000000)
1237
        mov     ecx, ((FONT and 11b) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_INACTIVE or 0x40000000)
1223
    @@:
1238
    @@:
1224
        movzx   edx, [fpu_mode]
1239
        movzx   edx, [fpu_mode]
Line 1225... Line 1240...
1225
        mov     edx, [btn2_tab+edx*4]
1240
        mov     edx, [btn2_tab+edx*4]
1226
 
1241
 
1227
        ; draw a text string in the window
1242
        ; draw a text string in the window
1228
        mov     ebx, [registers_x_pos_dd]
1243
        mov     ebx, [registers_x_pos_dd]
Line 1229... Line 1244...
1229
        add     ebx, 4*10000h+registers_y_pos+2
1244
        add     ebx, 4*10000h+REGISTERS_Y_POS
1230
        mcall   4
1245
        mcall   4
1231
 
1246
 
1232
        cmp     [reg_mode], REG_MODE_SSE
1247
        cmp     [reg_mode], REG_MODE_SSE
1233
        jz      @f
1248
        jz      @f
1234
        mov     ecx, (COLOR_TXT_INACTIVE or 0x40000000)
1249
        mov     ecx, ((FONT and 11b) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_INACTIVE or 0x40000000)
1235
    @@:
1250
    @@:
1236
        mov     edx, aSSE
1251
        mov     edx, aSSE
1237
        ; draw a text string in the window
1252
        ; draw a text string in the window
Line 1238... Line 1253...
1238
        mov     ebx, [registers_x_pos_dd]
1253
        mov     ebx, [registers_x_pos_dd]
1239
        add     ebx, 46*10000h+registers_y_pos+2
1254
        add     ebx, (7*FONT_X_SIZE+4)*10000h+REGISTERS_Y_POS
1240
        mcall   4
1255
        mcall   4
1241
 
1256
 
1242
        cmp     [reg_mode], REG_MODE_AVX
1257
        cmp     [reg_mode], REG_MODE_AVX
1243
        jz      @f
1258
        jz      @f
1244
        mov     ecx, (COLOR_TXT_INACTIVE or 0x40000000)
1259
        mov     ecx, ((FONT and 11b) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_INACTIVE or 0x40000000)
1245
    @@:
1260
    @@:
1246
        mov     edx, aAVX
1261
        mov     edx, aAVX
1247
        ; draw a text string in the window
1262
        ; draw a text string in the window
Line 1248... Line 1263...
1248
        mov     ebx, [registers_x_pos_dd]
1263
        mov     ebx, [registers_x_pos_dd]
1249
        add     ebx, 88*10000h+registers_y_pos+2
1264
        add     ebx, (14*FONT_X_SIZE+4)*10000h+REGISTERS_Y_POS
Line 1259... Line 1274...
1259
        mov     esi, _eax
1274
        mov     esi, _eax
1260
        push    4
1275
        push    4
1261
        pop     ecx
1276
        pop     ecx
1262
        mov     edx, regs_strs
1277
        mov     edx, regs_strs
1263
        mov     ebx, [registers_x_pos_dd]
1278
        mov     ebx, [registers_x_pos_dd]
1264
        add     ebx, 2*10000h+registers_y_pos+22
1279
        add     ebx, 2*10000h+REGISTERS_Y_POS+2*(FONT_Y_SIZE+TEXT_Y_CLEARANCE)
1265
        call    draw_register
1280
        call    draw_register
1266
        mov     ebx, [registers_x_pos_dd]
1281
        mov     ebx, [registers_x_pos_dd]
1267
        add     ebx, 2*10000h+registers_y_pos+32
1282
        add     ebx, 2*10000h+REGISTERS_Y_POS+3*(FONT_Y_SIZE+TEXT_Y_CLEARANCE)
1268
        add     esi, _ebx-_eax
1283
        add     esi, _ebx-_eax
1269
        call    draw_register
1284
        call    draw_register
1270
        mov     ebx, [registers_x_pos_dd]
1285
        mov     ebx, [registers_x_pos_dd]
1271
        add     ebx, 2*10000h+registers_y_pos+42
1286
        add     ebx, 2*10000h+REGISTERS_Y_POS+4*(FONT_Y_SIZE+TEXT_Y_CLEARANCE)
1272
        add     esi, _ecx-_ebx
1287
        add     esi, _ecx-_ebx
1273
        call    draw_register
1288
        call    draw_register
1274
        mov     ebx, [registers_x_pos_dd]
1289
        mov     ebx, [registers_x_pos_dd]
1275
        add     ebx, 2*10000h+registers_y_pos+52
1290
        add     ebx, 2*10000h+REGISTERS_Y_POS+5*(FONT_Y_SIZE+TEXT_Y_CLEARANCE)
1276
        add     esi, _edx-_ecx
1291
        add     esi, _edx-_ecx
1277
        call    draw_register
1292
        call    draw_register
1278
        mov     ebx, [registers_x_pos_dd]
1293
        mov     ebx, [registers_x_pos_dd]
1279
        add     ebx, 2*10000h+registers_y_pos+62
1294
        add     ebx, 2*10000h+REGISTERS_Y_POS+6*(FONT_Y_SIZE+TEXT_Y_CLEARANCE)
1280
        add     esi, _esi-_edx
1295
        add     esi, _esi-_edx
1281
        call    draw_register
1296
        call    draw_register
1282
        mov     ebx, [registers_x_pos_dd]
1297
        mov     ebx, [registers_x_pos_dd]
1283
        add     ebx, 2*10000h+registers_y_pos+72
1298
        add     ebx, 2*10000h+REGISTERS_Y_POS+7*(FONT_Y_SIZE+TEXT_Y_CLEARANCE)
1284
        add     esi, _edi-_esi
1299
        add     esi, _edi-_esi
1285
        call    draw_register
1300
        call    draw_register
1286
        mov     ebx, [registers_x_pos_dd]
1301
        mov     ebx, [registers_x_pos_dd]
1287
        add     ebx, 2*10000h+registers_y_pos+82
1302
        add     ebx, 2*10000h+REGISTERS_Y_POS+8*(FONT_Y_SIZE+TEXT_Y_CLEARANCE)
1288
        add     esi, _ebp-_edi
1303
        add     esi, _ebp-_edi
1289
        call    draw_register
1304
        call    draw_register
1290
        mov     ebx, [registers_x_pos_dd]
1305
        mov     ebx, [registers_x_pos_dd]
1291
        add     ebx, 2*10000h+registers_y_pos+92
1306
        add     ebx, 2*10000h+REGISTERS_Y_POS+9*(FONT_Y_SIZE+TEXT_Y_CLEARANCE)
1292
        add     esi, _esp-_ebp
1307
        add     esi, _esp-_ebp
1293
        call    draw_register
1308
        call    draw_register
1294
        mov     ebx, [registers_x_pos_dd]
1309
        mov     ebx, [registers_x_pos_dd]
1295
        add     ebx, 2*10000h+registers_y_pos+102
1310
        add     ebx, 2*10000h+REGISTERS_Y_POS+10*(FONT_Y_SIZE+TEXT_Y_CLEARANCE)
1296
        add     esi, _eip-_esp
1311
        add     esi, _eip-_esp
1297
        call    draw_register
1312
        call    draw_register
1298
        mov     ebx, [registers_x_pos_dd]
1313
        mov     ebx, [registers_x_pos_dd]
1299
        add     ebx, 2*10000h+registers_y_pos+112
1314
        add     ebx, 2*10000h+REGISTERS_Y_POS+11*(FONT_Y_SIZE+TEXT_Y_CLEARANCE)
Line 1300... Line 1315...
1300
 
1315
 
1301
        mov     cl, 7
1316
        mov     cl, 7
1302
        add     esi, _eflags-_eip
1317
        add     esi, _eflags-_eip
Line 1307... Line 1322...
1307
        call    draw_mmx_regs
1322
        call    draw_mmx_regs
1308
        jmp     @f
1323
        jmp     @f
1309
.fpu:
1324
  .fpu:
1310
        call    draw_fpu_regs
1325
        call    draw_fpu_regs
1311
@@:
1326
    @@:
1312
        mov     ecx, COLOR_TXT_INACTIVE
1327
        mov     ecx, (FONT and 11b) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_INACTIVE
1313
        cmp     [debuggee_pid], 0
1328
        cmp     [debuggee_pid], 0
1314
        jz      @f
1329
        jz      @f
1315
        cmp     [bSuspended], 0
1330
        cmp     [bSuspended], 0
1316
        jz      @f
1331
        jz      @f
1317
        mov     ecx, COLOR_TXT_NORMAL
1332
        mov     ecx, (FONT and 11b) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_NORMAL
1318
    @@:
1333
    @@:
1319
        mov     edx, aColon
1334
        mov     edx, aColon
1320
        xor     esi, esi
1335
        xor     esi, esi
1321
        inc     esi
1336
        inc     esi
1322
        mov     ebx, [registers_x_pos_dd]
1337
        mov     ebx, [registers_x_pos_dd]
1323
        add     ebx, 10*10000h+registers_y_pos+122
1338
        add     ebx, 10*10000h+REGISTERS_Y_POS+12*(FONT_Y_SIZE+TEXT_Y_CLEARANCE)
1324
        mcall   4
1339
        mcall   4
1325
        mov     edx, flags
1340
        mov     edx, flags
Line 1326... Line 1341...
1326
 
1341
 
1327
    @@:
1342
    @@:
1328
        add     ebx, 2*6*10000h
1343
        add     ebx, 2*FONT_X_SIZE*10000h
1329
        call    draw_flag
1344
        call    draw_flag
1330
        inc     edx
1345
        inc     edx
1331
        cmp     dl, flags_bits and 0xFF
1346
        cmp     dl, flags_bits and 0xFF
1332
        jnz     @b
1347
        jnz     @b
Line 1350... Line 1365...
1350
;                 Draw all registers sets
1365
;                 Draw all registers sets
1351
draw_registers:
1366
draw_registers:
Line 1352... Line 1367...
1352
 
1367
 
1353
        ; draw container rectangle/box with COLOR_BG_NORMAL
1368
        ; draw container rectangle/box with COLOR_BG_NORMAL
1354
        mov     ebx, [registers_x_pos_dd]
1369
        mov     ebx, [registers_x_pos_dd]
1355
        add     ebx, (-1)*10000h+(registers_x_size+2)
1370
        add     ebx, (-1)*10000h+(REGISTERS_X_SIZE+2)
1356
        mov     ecx, [registers_y_size_dd+4]
1371
        mov     ecx, [registers_y_size_dd+4]
1357
        add     ecx, (registers_y_pos-1)*10000h+2
1372
        add     ecx, ((TITLE_Y_POS+(FONT_Y_SIZE/2))+1)*10000h+2
1358
        mcall   13, , , COLOR_BG_NORMAL
1373
        mcall   13, , , COLOR_BG_NORMAL
Line 1359... Line 1374...
1359
        call    draw_reg_title
1374
        call    draw_reg_title
1360
 
1375
 
Line 1378... Line 1393...
1378
;                     Display memory dump
1393
;                     Display memory dump
Line 1379... Line 1394...
1379
 
1394
 
1380
draw_dump:
1395
draw_dump:
1381
        ; draw container rectangle/box in the window
1396
        ; draw container rectangle/box in the window
1382
        mov     ebx, [data_x_size_dd+4]
1397
        mov     ebx, [data_x_size_dd+4]
1383
        add     ebx, data_x_pos*10000h
1398
        add     ebx, DATA_X_POS*10000h
Line 1384... Line 1399...
1384
        mcall   13, , dump_y_pos*10000h+dump_y_size, COLOR_BG_NORMAL
1399
        mcall   13, , DUMP_Y_POS*10000h+DUMP_Y_SIZE, COLOR_BG_NORMAL
1385
 
1400
 
1386
    .redraw:
1401
    .redraw:
1387
        ; addresses
1402
        ; addresses
1388
        mov     ebx, 80100h
1403
        mov     ebx, 80100h
1389
        mov     edx, data_x_pos*10000h + dump_y_pos
1404
        mov     edx, DATA_X_POS*10000h + DUMP_Y_POS
1390
        mov     ecx, [dumppos]
1405
        mov     ecx, [dumppos]
1391
        mov     edi, COLOR_BG_NORMAL
1406
        mov     edi, COLOR_BG_NORMAL
1392
        mov     esi, (COLOR_TXT_INACTIVE or 0x40000000)
1407
        mov     esi, ((FONT and 11b) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_INACTIVE or 0x40000000)
1393
        cmp     [debuggee_pid], 0
1408
        cmp     [debuggee_pid], 0
1394
        jz      @f
1409
        jz      @f
1395
        cmp     [bSuspended], 0
1410
        cmp     [bSuspended], 0
1396
        jz      @f
1411
        jz      @f
1397
        mov     esi, (COLOR_TXT_NORMAL or 0x40000000)
1412
        mov     esi, ((FONT and 11b) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_NORMAL or 0x40000000)
1398
    @@:
1413
    @@:
1399
        ; draw a number in the window
1414
        ; draw a number in the window
1400
        mcall   47
1415
        mcall   47
1401
        add     ecx, 10h
1416
        add     ecx, 10h
1402
        add     edx, 10
1417
        add     edx, FONT_Y_SIZE + TEXT_Y_CLEARANCE
1403
        cmp     dl, dump_y_pos + dump_y_size
1418
        cmp     dl, DUMP_Y_POS + DUMP_Y_SIZE
1404
        jb      @b
1419
        jb      @b
1405
        ; hex dump of data
1420
        ; hex dump of data
1406
        mov     ecx, dumpdata
1421
        mov     ecx, dumpdata
1407
        push    ecx
1422
        push    ecx
1408
        xor     ebx, ebx
1423
        xor     ebx, ebx
1409
        mov     edx, (data_x_pos+12*6)*10000h + dump_y_pos
1424
        mov     edx, (DATA_X_POS+12*FONT_X_SIZE)*10000h + DUMP_Y_POS
Line 1410... Line 1425...
1410
        cmp     [dumpread], ebx
1425
        cmp     [dumpread], ebx
1411
        jz      .hexdumpdone1
1426
        jz      .hexdumpdone1
1412
 
1427
 
1413
    .hexdumploop1:
1428
    .hexdumploop1:
1414
        push    ebx
1429
        push    ebx
1415
        mov     ebx, 20101h
1430
        mov     ebx, 20101h
1416
        ; draw a number in the window
1431
        ; draw a number in the window
1417
        mcall
1432
        mcall
1418
        pop     ebx
1433
        pop     ebx
1419
        add     edx, 3*6*10000h
1434
        add     edx, 3*FONT_X_SIZE*10000h
1420
        inc     ecx
1435
        inc     ecx
1421
        inc     ebx
1436
        inc     ebx
1422
        test    bl, 15
1437
        test    bl, 15
1423
        jz      .16
1438
        jz      .16
Line 1424... Line 1439...
1424
        test    bl, 7
1439
        test    bl, 7
1425
        jnz     @f
1440
        jnz     @f
Line 1426... Line 1441...
1426
        add     edx, 2*6*10000h - 10 + 6*(3*10h+2)*10000h
1441
        add     edx, 2*FONT_X_SIZE*10000h - (FONT_Y_SIZE+TEXT_Y_CLEARANCE) + FONT_X_SIZE*(3*10h+2)*10000h
1427
 
1442
 
1428
    .16:
1443
    .16:
Line 1440... Line 1455...
1440
        xchg    ebx, edx
1455
        xchg    ebx, edx
1441
        push    2
1456
        push    2
1442
        pop     esi
1457
        pop     esi
Line 1443... Line 1458...
1443
 
1458
 
1444
    .hexdumploop2:
1459
    .hexdumploop2:
1445
        cmp     edx, dump_height*10h
1460
        cmp     edx, DUMP_HEIGHT*10h
1446
        jae     .hexdumpdone2
1461
        jae     .hexdumpdone2
1447
        push    edx
1462
        push    edx
1448
        mov     edx, aQuests
1463
        mov     edx, aQuests
1449
        ; draw text string with color in ecx, copied from esi
1464
        ; draw text string with color in ecx, copied from esi
1450
        mcall
1465
        mcall
1451
        pop     edx
1466
        pop     edx
1452
        add     ebx, 3*6*10000h
1467
        add     ebx, 3*FONT_X_SIZE*10000h
1453
        inc     edx
1468
        inc     edx
1454
        test    dl, 15
1469
        test    dl, 15
1455
        jz      .16x
1470
        jz      .16x
1456
        test    dl, 7
1471
        test    dl, 7
1457
        jnz     .hexdumploop2
1472
        jnz     .hexdumploop2
Line 1458... Line 1473...
1458
        add     ebx, 2*6*10000h - 10 + 6*(3*10h+2)*10000h
1473
        add     ebx, 2*FONT_X_SIZE*10000h - (FONT_Y_SIZE+TEXT_Y_CLEARANCE) + FONT_X_SIZE*(3*10h+2)*10000h
1459
 
1474
 
1460
    .16x:
1475
  .16x:
Line 1461... Line 1476...
1461
        add     ebx, 10 - 6*(3*10h+2)*10000h
1476
        add     ebx, (FONT_Y_SIZE+TEXT_Y_CLEARANCE) - FONT_X_SIZE*(3*10h+2)*10000h
1462
        jmp     .hexdumploop2
1477
        jmp     .hexdumploop2
1463
 
1478
 
1464
    .hexdumpdone2:
1479
  .hexdumpdone2:
1465
        dec     esi
1480
        dec     esi
Line 1466... Line 1481...
1466
        ; colon, minus signs
1481
        ; colon, minus signs
1467
        mov     ebx, (data_x_pos+8*6)*10000h + dump_y_pos
1482
        mov     ebx, (DATA_X_POS+8*FONT_X_SIZE)*10000h + DUMP_Y_POS
1468
        mov     edx, aColon
1483
        mov     edx, aColon
1469
 
1484
 
1470
    @@:
1485
    @@:
1471
        mcall
1486
        mcall
1472
        add     ebx, 10
1487
        add     ebx, (FONT_Y_SIZE+TEXT_Y_CLEARANCE)
Line 1473... Line 1488...
1473
        cmp     bl, dump_y_pos+dump_height*10
1488
        cmp     bl, DUMP_Y_POS+DUMP_HEIGHT*(FONT_Y_SIZE+TEXT_Y_CLEARANCE)
1474
        jb      @b
1489
        jb      @b
1475
        mov     ebx, (data_x_pos+(12+3*8)*6)*10000h + dump_y_pos
1490
        mov     ebx, (DATA_X_POS+(12+3*8)*FONT_X_SIZE)*10000h + DUMP_Y_POS
1476
        mov     edx, aMinus
1491
        mov     edx, aMinus
1477
 
1492
 
1478
    @@:
1493
    @@:
1479
        mcall
1494
        mcall
1480
        add     ebx, 10
1495
        add     ebx, (FONT_Y_SIZE+TEXT_Y_CLEARANCE)
1481
        cmp     bl, dump_y_pos+dump_height*10
1496
        cmp     bl, DUMP_Y_POS+DUMP_HEIGHT*(FONT_Y_SIZE+TEXT_Y_CLEARANCE)
Line 1482... Line 1497...
1482
        jb      @b
1497
        jb      @b
1483
        ; ASCII data
1498
        ; ASCII data
1484
        mov     ebx, (data_x_pos+(12+3*10h+2+2)*6)*10000h + dump_y_pos
1499
        mov     ebx, (DATA_X_POS+(12+3*10h+2+2)*FONT_X_SIZE)*10000h + DUMP_Y_POS
1485
        pop     edx
1500
        pop     edx
Line 1494... Line 1509...
1494
    @@:
1509
    @@:
1495
        ; draw a text string in the window, color in ecx
1510
        ; draw a text string in the window, color in ecx
1496
        mcall
1511
        mcall
1497
        pop     edx
1512
        pop     edx
1498
        inc     edx
1513
        inc     edx
1499
        add     ebx, 6*10000h
1514
        add     ebx, FONT_X_SIZE*10000h
1500
        dec     dword [esp]
1515
        dec     dword [esp]
1501
        jz      .asciidone
1516
        jz      .asciidone
1502
        test    byte [esp], 15
1517
        test    byte [esp], 15
1503
        jnz     .asciiloop
1518
        jnz     .asciiloop
1504
        add     ebx, 10 - 6*10h*10000h
1519
        add     ebx, (FONT_Y_SIZE+TEXT_Y_CLEARANCE) - FONT_X_SIZE*10h*10000h
1505
        jmp     .asciiloop
1520
        jmp     .asciiloop
Line 1506... Line 1521...
1506
 
1521
 
1507
    .asciidone:
1522
    .asciidone:
1508
        pop     ecx
1523
        pop     ecx
Line 1520... Line 1535...
1520
    .loop:
1535
    .loop:
1521
        mov     eax, [disasm_cur_pos]
1536
        mov     eax, [disasm_cur_pos]
1522
        call    find_symbol
1537
        call    find_symbol
1523
        jc      .nosymb
1538
        jc      .nosymb
1524
        mov     ebx, [disasm_cur_str]
1539
        mov     ebx, [disasm_cur_str]
1525
        imul    ebx, 10
1540
        imul    ebx, (FONT_Y_SIZE+TEXT_Y_CLEARANCE)
1526
        push    ebx
1541
        push    ebx
1527
        lea     ecx, [ebx+disasm_y_pos-1]
1542
        lea     ecx, [ebx+DISASM_Y_POS-1]
1528
        shl     ecx, 16
1543
        shl     ecx, 16
1529
        mov     cl, 11
1544
        mov     cl, 11
1530
        ; setting up background color for disassembled text
1545
        ; setting up background color for disassembled text
1531
        mov     edx, COLOR_BG_NORMAL
1546
        mov     edx, COLOR_BG_NORMAL
1532
        ; draw container rectangle/box with color COLOR_BG_NORMAL (was 0xFFFFFF - white)
1547
        ; draw container rectangle/box with color COLOR_BG_NORMAL (was 0xFFFFFF - white)
1533
        mov     ebx, [data_x_size_dd+4]
1548
        mov     ebx, [data_x_size_dd+4]
1534
        add     ebx, data_x_pos*10000h
1549
        add     ebx, DATA_X_POS*10000h
1535
        mcall   13
1550
        mcall   13
1536
        pop     ebx
1551
        pop     ebx
1537
        ; copy color value from edx (COLOR_BG_NORMAL)
1552
        ; copy color value from edx (COLOR_BG_NORMAL)
1538
        mov     edi, edx
1553
        mov     edi, edx
1539
        add     ebx, (data_x_pos+6*2)*10000h+disasm_y_pos
1554
        add     ebx, (DATA_X_POS+FONT_X_SIZE*2)*10000h+DISASM_Y_POS
1540
        mov     edx, esi
1555
        mov     edx, esi
Line 1541... Line 1556...
1541
 
1556
 
1542
    @@:
1557
    @@:
1543
        lodsb
1558
        lodsb
1544
        test    al, al
1559
        test    al, al
1545
        jnz     @b
1560
        jnz     @b
1546
        mov     byte [esi-1], ':'
1561
        mov     byte [esi-1], ':'
1547
        sub     esi, edx
1562
        sub     esi, edx
1548
        ; normal color
1563
        ; normal color
1549
        ; was 0x40000000
1564
        ; was 0x40000000
1550
        mov     ecx, (COLOR_TXT_LABEL or 0x40000000)
1565
        mov     ecx, ((FONT and 11b) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_LABEL or 0x40000000)
1551
        mov     al, 4
1566
        mov     al, 4
1552
        ; draw a text string in the window with color COLOR_TXT_NORMAL in ecx
1567
        ; draw a text string in the window with color COLOR_TXT_NORMAL in ecx
1553
        mcall
1568
        mcall
1554
        mov     byte [esi+edx-1], 0
1569
        mov     byte [esi+edx-1], 0
Line 1557... Line 1572...
1557
        shr     ebx, 16
1572
        shr     ebx, 16
1558
        lea     ebx, [ebx+esi*2]
1573
        lea     ebx, [ebx+esi*2]
1559
        shl     ecx, 16
1574
        shl     ecx, 16
1560
        mov     cl, 10
1575
        mov     cl, 10
1561
        imul    ebx, 10001h
1576
        imul    ebx, 10001h
1562
        sub     bx, data_x_pos
1577
        sub     bx, DATA_X_POS
1563
        sub     bx, word[data_x_size_dd+4]
1578
        sub     bx, word[data_x_size_dd+4]
1564
        neg     bx
1579
        neg     bx
1565
        mov     al, 13
1580
        mov     al, 13
1566
        ; copy color value from edi
1581
        ; copy color value from edi
1567
        mov     edx, edi
1582
        mov     edx, edi
Line 1576... Line 1591...
1576
        push    [disasm_cur_pos]
1591
        push    [disasm_cur_pos]
1577
        call    disasm_instr
1592
        call    disasm_instr
1578
        pop     ebp
1593
        pop     ebp
1579
        jc      .loopend
1594
        jc      .loopend
1580
        mov     edx, COLOR_BG_NORMAL
1595
        mov     edx, COLOR_BG_NORMAL
1581
        mov     esi, COLOR_TXT_NORMAL
1596
        mov     esi, (FONT and 11b) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_NORMAL
1582
        mov     ebx, data_x_pos*10000h
1597
        mov     ebx, DATA_X_POS*10000h
1583
        add     ebx, [data_x_size_dd+4]
1598
        add     ebx, [data_x_size_dd+4]
1584
        mov     ecx, [disasm_cur_str]
1599
        mov     ecx, [disasm_cur_str]
1585
        imul    ecx, 10*10000h
1600
        imul    ecx, (FONT_Y_SIZE+TEXT_Y_CLEARANCE)*10000h
1586
        add     ecx, (disasm_y_pos-1)*10000h + 10
1601
        add     ecx, (DISASM_Y_POS-1)*10000h + (FONT_Y_SIZE+TEXT_Y_CLEARANCE)
1587
        mov     eax, ebp
1602
        mov     eax, ebp
1588
        pushad
1603
        pushad
1589
        call    find_enabled_breakpoint
1604
        call    find_enabled_breakpoint
1590
        popad
1605
        popad
1591
        jnz     .nobp
1606
        jnz     .nobp
1592
        mov     edx, COLOR_BG_BREAKPOINT
1607
        mov     edx, COLOR_BG_BREAKPOINT
1593
        mov     esi, COLOR_TXT_BREAKPOINT
1608
        mov     esi, (FONT and 11b) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_BREAKPOINT
1594
    .nobp:
1609
    .nobp:
Line 1595... Line 1610...
1595
 
1610
 
1596
        mov     eax, [_eip]
1611
        mov     eax, [_eip]
1597
        cmp     eax, ebp
1612
        cmp     eax, ebp
1598
        jnz     .notcurrent
1613
        jnz     .notcurrent
1599
        mov     edx, COLOR_BG_SELECTED
1614
        mov     edx, COLOR_BG_SELECTED
1600
        mov     esi, COLOR_TXT_SELECTED
1615
        mov     esi, (FONT and 11b) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_SELECTED
1601
    .notcurrent:
1616
    .notcurrent:
Line 1602... Line 1617...
1602
        push    esi     ; Save color value for disassembled text
1617
        push    esi     ; Save color value for disassembled text
1603
 
1618
 
1604
        ; draw container rectangle/box for disassembled text
1619
        ; draw container rectangle/box for disassembled text
Line 1605... Line 1620...
1605
        ; color in edx
1620
        ; color in edx
1606
        mcall   13
1621
        mcall   13
1607
 
1622
 
1608
        mov     edx, [disasm_cur_str]
1623
        mov     edx, [disasm_cur_str]
1609
        imul    edx, 10
1624
        imul    edx, (FONT_Y_SIZE+TEXT_Y_CLEARANCE)
Line 1610... Line 1625...
1610
        add     edx, data_x_pos*10000h + disasm_y_pos
1625
        add     edx, DATA_X_POS*10000h + DISASM_Y_POS
1611
        ; draw a number in the window, color in esi
1626
        ; draw a number in the window, color in esi
1612
        mcall   47, 80100h, ebp
1627
        mcall   47, 80100h, ebp
1613
 
1628
 
1614
        lea     ebx, [edx+8*6*10000h]
1629
        lea     ebx, [edx+8*FONT_X_SIZE*10000h]
1615
        mov     ecx, esi    ; text color
1630
        mov     ecx, esi    ; text color
1616
        push    2
1631
        push    2
1617
        pop     esi
1632
        pop     esi
1618
        mov     edx, aColon
1633
        mov     edx, aColon
1619
        ; draw the colon
1634
        ; draw the colon
1620
        mcall   4
1635
        mcall   4
1621
        push    9
1636
        push    9
1622
        pop     edi
1637
        pop     edi
Line 1623... Line 1638...
1623
        lea     edx, [ebx+2*6*10000h]
1638
        lea     edx, [ebx+2*FONT_X_SIZE*10000h]
1624
        mov     ecx, ebp
1639
        mov     ecx, ebp
1625
        sub     ecx, [disasm_start_pos]
1640
        sub     ecx, [disasm_start_pos]
1626
        add     ecx, disasm_buffer
1641
        add     ecx, disasm_buffer
1627
 
1642
 
1628
        mov     esi, COLOR_TXT_HEX
1643
        mov     esi, (FONT and 11b) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_HEX
1629
        mov     eax, [_eip]
1644
        mov     eax, [_eip]
1630
        cmp     eax, ebp
1645
        cmp     eax, ebp
1631
        jnz     @f
1646
        jnz     @f
1632
        mov     esi, COLOR_TXT_SELECTED
1647
        mov     esi, (FONT and 11b) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_SELECTED
1633
  @@:
1648
  @@:
1634
    .drawhex:
1649
    .drawhex:
1635
        ; draw a number in the window, color in esi
1650
        ; draw a number in the window, color in esi
1636
        mcall   47, 20101h
1651
        mcall   47, 20101h
1637
        add     edx, 6*3*10000h
1652
        add     edx, FONT_X_SIZE*3*10000h
Line 1646... Line 1661...
1646
        dec     esi
1661
        dec     esi
1647
        cmp     esi, ebp
1662
        cmp     esi, ebp
1648
        pop     esi
1663
        pop     esi
1649
        jbe     .drawhex
1664
        jbe     .drawhex
Line 1650... Line 1665...
1650
 
1665
 
1651
        lea     ebx, [edx-6*10000h]
1666
        lea     ebx, [edx-FONT_X_SIZE*10000h]
1652
        ; copy color value from esi
1667
        ; copy color value from esi
1653
        mov     ecx, esi
1668
        mov     ecx, esi
1654
        push    3
1669
        push    3
1655
        pop     esi
1670
        pop     esi
Line 1666... Line 1681...
1666
        repnz scasb
1681
        repnz scasb
1667
        not     ecx
1682
        not     ecx
1668
        dec     ecx
1683
        dec     ecx
1669
        xchg    ecx, esi
1684
        xchg    ecx, esi
1670
        mov     ebx, [disasm_cur_str]
1685
        mov     ebx, [disasm_cur_str]
1671
        imul    ebx, 10
1686
        imul    ebx, (FONT_Y_SIZE+TEXT_Y_CLEARANCE)
1672
        add     ebx, (data_x_pos+6*40)*10000h+disasm_y_pos
1687
        add     ebx, (DATA_X_POS+FONT_X_SIZE*40)*10000h+DISASM_Y_POS
Line 1673... Line 1688...
1673
 
1688
 
1674
        ; draw a text string in the window, color in ecx
1689
        ; draw a text string in the window, color in ecx
1675
        mcall   4
1690
        mcall   4
1676
        inc     [disasm_cur_str]
1691
        inc     [disasm_cur_str]
Line 1680... Line 1695...
1680
 
1695
 
1681
    .loopend:
1696
    .loopend:
1682
        mov     ecx, [disasm_height_dd]
1697
        mov     ecx, [disasm_height_dd]
1683
        sub     ecx, [disasm_cur_str]
1698
        sub     ecx, [disasm_cur_str]
1684
        jz      @f
1699
        jz      @f
1685
        imul    ecx, 10
1700
        imul    ecx, (FONT_Y_SIZE+TEXT_Y_CLEARANCE)
1686
        inc     ecx
1701
        inc     ecx
1687
        mov     eax, disasm_y_pos
1702
        mov     eax, DISASM_Y_POS
1688
        add     eax, [disasm_y_size_dd+4]
1703
        add     eax, [disasm_y_size_dd+4]
1689
        sub     eax, ecx
1704
        sub     eax, ecx
1690
        shl     eax, 16
1705
        shl     eax, 16
1691
        add     ecx, eax
1706
        add     ecx, eax
1692
        ; Draw filled rectangle
1707
        ; Draw filled rectangle
1693
        mov     ebx, [data_x_size_dd+4]
1708
        mov     ebx, [data_x_size_dd+4]
1694
        add     ebx, data_x_pos*10000h
1709
        add     ebx, DATA_X_POS*10000h
Line 1695... Line 1710...
1695
        mcall   13, , , COLOR_BG_NORMAL
1710
        mcall   13, , , COLOR_BG_NORMAL
1696
 
1711
 
Line 1785... Line 1800...
1785
        add     esi, ebx
1800
        add     esi, ebx
1786
        mcall   67, -1, -1      ; set the new sizes
1801
        mcall   67, -1, -1      ; set the new sizes
Line 1787... Line 1802...
1787
 
1802
 
1788
        ; (re)calculate coordinates of GUI elements
1803
        ; (re)calculate coordinates of GUI elements
1789
        mov     eax, [thread_info.client_box.width]
1804
        mov     eax, [thread_info.client_box.width]
1790
        sub     eax, data_x_pos + data_x_pos + registers_x_size+3
1805
        sub     eax, DATA_X_POS + DATA_X_POS + REGISTERS_X_SIZE+3
1791
        mov     [data_x_size_dd+4], eax
1806
        mov     [data_x_size_dd+4], eax
1792
        mov     [messages_x_size_dd+4], eax
1807
        mov     [messages_x_size_dd+4], eax
1793
        shl     eax, 16
1808
        shl     eax, 16
1794
        mov     [data_x_size_dd], eax
1809
        mov     [data_x_size_dd], eax
1795
        mov     [messages_x_size_dd], eax
1810
        mov     [messages_x_size_dd], eax
1796
        shr     eax, 16
1811
        shr     eax, 16
1797
        add     eax, data_x_pos + 4
1812
        add     eax, DATA_X_POS + 4
1798
        mov     [registers_x_pos_dd+4], eax
1813
        mov     [registers_x_pos_dd+4], eax
1799
        shl     eax, 16
1814
        shl     eax, 16
Line 1800... Line 1815...
1800
        mov     [registers_x_pos_dd], eax
1815
        mov     [registers_x_pos_dd], eax
1801
 
1816
 
1802
        mov     eax, [thread_info.client_box.height]
1817
        mov     eax, [thread_info.client_box.height]
1803
        sub     eax, cmdline_y_size + data_x_pos
1818
        sub     eax, CMD_Y_SIZE + DATA_X_POS
1804
        mov     [cmdline_y_pos_dd+4], eax
1819
        mov     [cmdline_y_pos_dd+4], eax
1805
        shl     eax, 16
1820
        shl     eax, 16
1806
        mov     [cmdline_y_pos_dd], eax
1821
        mov     [cmdline_y_pos_dd], eax
1807
        shr     eax, 16
1822
        shr     eax, 16
1808
        sub     eax, messages_y_size + 4
1823
        sub     eax, MSG_Y_SIZE + 4
1809
        mov     [messages_y_pos_dd+4], eax
1824
        mov     [messages_y_pos_dd+4], eax
1810
        shl     eax, 16
1825
        shl     eax, 16
1811
        mov     [messages_y_pos_dd], eax
1826
        mov     [messages_y_pos_dd], eax
1812
        shr     eax, 16
1827
        shr     eax, 16
1813
        sub     eax, disasm_y_pos + 4
1828
        sub     eax, DISASM_Y_POS + 4
1814
        mov     [disasm_y_size_dd+4], eax
1829
        mov     [disasm_y_size_dd+4], eax
1815
        shl     eax, 16
1830
        shl     eax, 16
1816
        mov     [disasm_y_size_dd], eax
1831
        mov     [disasm_y_size_dd], eax
1817
        shr     eax, 16
1832
        shr     eax, 16
1818
        mov     ecx, 10
1833
        mov     ecx, (FONT_Y_SIZE+TEXT_Y_CLEARANCE)
1819
        xor     edx, edx
1834
        xor     edx, edx
Line 1820... Line 1835...
1820
        div     ecx
1835
        div     ecx
1821
        mov     [disasm_height_dd], eax
1836
        mov     [disasm_height_dd], eax
1822
 
1837
 
1823
        mov     eax, [thread_info.client_box.height]
1838
        mov     eax, [thread_info.client_box.height]
1824
        sub     eax, data_x_pos + registers_y_pos-1
1839
        sub     eax, DATA_X_POS + TITLE_Y_POS+(FONT_Y_SIZE/2)+2
Line 1825... Line 1840...
1825
        mov     [registers_y_size_dd+4], eax
1840
        mov     [registers_y_size_dd+4], eax
1826
        shl     eax, 16
1841
        shl     eax, 16
1827
        mov     [registers_y_size_dd], eax
1842
        mov     [registers_y_size_dd], eax
1828
 
1843
 
1829
        ; messages frame
1844
        ; messages frame
1830
        mov     ebx, [messages_x_size_dd+4]
1845
        mov     ebx, [messages_x_size_dd+4]
1831
        add     ebx, (messages_x_pos-2)*10000h + (messages_x_pos+2)
1846
        add     ebx, (MSG_X_POS-2)*10000h + (MSG_X_POS+2)
1832
        push    ebx
1847
        push    ebx
1833
        mov     ecx, [messages_y_pos_dd+2]
1848
        mov     ecx, [messages_y_pos_dd+2]
1834
        add     ecx, -2*10001h
1849
        add     ecx, -2*10001h
1835
        mov     edx, COLOR_LINE
1850
        mov     edx, COLOR_LINE
1836
        mcall   38
1851
        mcall   38
1837
        add     ecx, (messages_y_size+2+2)*10001h
1852
        add     ecx, (MSG_Y_SIZE+2+2)*10001h
1838
        mcall
1853
        mcall
1839
        mov     ebx, (messages_x_pos-2)*10001h
1854
        mov     ebx, (MSG_X_POS-2)*10001h
1840
        push    ebx
1855
        push    ebx
1841
        mov     ecx, [messages_y_pos_dd+2]
1856
        mov     ecx, [messages_y_pos_dd+2]
1842
        add     ecx, (-2*10000h) + (messages_y_size+2)
1857
        add     ecx, (-2*10000h) + (MSG_Y_SIZE+2)
1843
        mcall
1858
        mcall
Line 1844... Line 1859...
1844
        mov     ebx, [messages_x_size_dd+2]
1859
        mov     ebx, [messages_x_size_dd+2]
1845
        add     ebx, (messages_x_pos+2)*10001h
1860
        add     ebx, (MSG_X_POS+2)*10001h
1846
        push    ebx
1861
        push    ebx
1847
        mcall
1862
        mcall
1848
 
1863
 
1849
        ; command line frame
1864
        ; command line frame
1850
        mov     ecx, [cmdline_y_pos_dd+2]
1865
        mov     ecx, [cmdline_y_pos_dd+2]
1851
        add     ecx, (-2*10000h) + (cmdline_y_size+2)
1866
        add     ecx, (-2*10000h) + (CMD_Y_SIZE+2)
1852
        pop     ebx
1867
        pop     ebx
1853
        mcall
1868
        mcall
Line 1854... Line 1869...
1854
        pop     ebx
1869
        pop     ebx
1855
        mcall
1870
        mcall
1856
        pop     ebx
1871
        pop     ebx
1857
        mov     ecx, [cmdline_y_pos_dd+2]
1872
        mov     ecx, [cmdline_y_pos_dd+2]
Line 1858... Line 1873...
1858
        add     ecx, (cmdline_y_size+2)*10001h
1873
        add     ecx, (CMD_Y_SIZE+2)*10001h
1859
 
1874
 
1860
        mcall
1875
        mcall
1861
        mov     ecx, [cmdline_y_pos_dd+2]
1876
        mov     ecx, [cmdline_y_pos_dd+2]
1862
        add     ecx, (-2*10001h)
1877
        add     ecx, (-2*10001h)
1863
        mcall
1878
        mcall
1864
 
1879
 
1865
        ; registers frame
1880
        ; registers frame
1866
        mov     ebx, [registers_x_pos_dd]
1881
        mov     ebx, [registers_x_pos_dd]
1867
        add     ebx, (-2) shl 16 + (registers_x_size+3)
1882
        add     ebx, (-2) shl 16 + (REGISTERS_X_SIZE+3)
1868
        mov     ecx, (registers_y_pos-2) shl 16 + 1
1883
        mov     ecx, (TITLE_Y_POS+(FONT_Y_SIZE/2)) shl 16 + 1
1869
        mov     edx, COLOR_LINE
1884
        mov     edx, COLOR_LINE
1870
        mcall   13                      ; top
1885
        mcall   13                      ; top
1871
        mov     ebx, [registers_x_pos_dd]
1886
        mov     ebx, [registers_x_pos_dd]
1872
        add     ebx, ((-2)+(registers_x_size+3)) shl 16 +1
1887
        add     ebx, ((-2)+(REGISTERS_X_SIZE+3)) shl 16 + 1
1873
        mov     ecx, [registers_y_size_dd+4]
1888
        mov     ecx, [registers_y_size_dd+4]
Line 1874... Line 1889...
1874
        add     ecx, (registers_y_pos-2) shl 16 + (+3+1)
1889
        add     ecx, (TITLE_Y_POS+(FONT_Y_SIZE/2)) shl 16 + (+3+1)
1875
        mcall                           ; right
1890
        mcall                           ; right
Line 1876... Line 1891...
1876
        mov     ebx, [registers_x_pos_dd]
1891
        mov     ebx, [registers_x_pos_dd]
1877
        add     ebx, (-2) shl 16 + (registers_x_size+3)
1892
        add     ebx, (-2) shl 16 + (REGISTERS_X_SIZE+3+1)
1878
        mov     ecx, [registers_y_size_dd]
1893
        mov     ecx, [registers_y_size_dd]
Line 1879... Line 1894...
1879
        add     ecx, ((registers_y_pos-2)+(+3)) shl 16 + 1
1894
        add     ecx, ((TITLE_Y_POS+(FONT_Y_SIZE/2))+4) shl 16 + 1
1880
        mcall                           ; bottom
1895
        mcall                           ; bottom
1881
 
1896
 
1882
        ; messages
1897
        ; messages
1883
        call    draw_messages
1898
        call    draw_messages
1884
 
1899
 
1885
        ; command line & cursor
1900
        ; command line & cursor
1886
        call    draw_cmdline
1901
        call    draw_cmdline
1887
        call    draw_cursor
1902
        call    draw_cursor
1888
 
1903
 
1889
        ; title & registers & dump & disasm
1904
        ; title & registers & dump & disasm
1890
        mov     ebx, (data_x_pos-2)*10001h
1905
        mov     ebx, (DATA_X_POS-2)*10001h
1891
        mov     ecx, (title_y_pos+5)*10000h + (-2)
1906
        mov     ecx, (TITLE_Y_POS+(FONT_Y_SIZE/2))*10000h + (-2)
Line 1892... Line 1907...
1892
        add     ecx, [messages_y_pos_dd+4]
1907
        add     ecx, [messages_y_pos_dd+4]
1893
        mov     edx, COLOR_LINE
1908
        mov     edx, COLOR_LINE
1894
        mcall   38
1909
        mcall   38
1895
        mov     ebx, [data_x_size_dd+2]
1910
        mov     ebx, [data_x_size_dd+2]
1896
        add     ebx, (data_x_pos+2)*10001h
1911
        add     ebx, (DATA_X_POS+2)*10001h
1897
        mcall
1912
        mcall