|
@@ -49,6 +49,28 @@ section .data
|
49
|
49
|
dq OP.gt ; t
|
50
|
50
|
dq OP.eq ; u
|
51
|
51
|
|
|
52
|
+ opt_chr: ; pointers on OP chr repr
|
|
53
|
+ OPT_CHR a, "T"
|
|
54
|
+ OPT_CHR b, "Put"
|
|
55
|
+ OPT_CHR c, "Drop"
|
|
56
|
+ OPT_CHR d, "*"
|
|
57
|
+ OPT_CHR e, "/"
|
|
58
|
+ OPT_CHR f, "+"
|
|
59
|
+ OPT_CHR g, "-"
|
|
60
|
+ OPT_CHR h, "%"
|
|
61
|
+ OPT_CHR j, "<<"
|
|
62
|
+ OPT_CHR k, ">>"
|
|
63
|
+ OPT_CHR l, "&"
|
|
64
|
+ OPT_CHR m, "|"
|
|
65
|
+ OPT_CHR n, "^"
|
|
66
|
+ OPT_CHR o, "Not"
|
|
67
|
+ OPT_CHR p, "Dup"
|
|
68
|
+ OPT_CHR q, "Pck"
|
|
69
|
+ OPT_CHR r, "Swp"
|
|
70
|
+ OPT_CHR s, "<"
|
|
71
|
+ OPT_CHR t, ">"
|
|
72
|
+ OPT_CHR eq, "="
|
|
73
|
+
|
52
|
74
|
|
53
|
75
|
audiospec_wanted: ; SDL_audio configuration
|
54
|
76
|
dd 8000 ; freq
|
|
@@ -75,6 +97,7 @@ section .data
|
75
|
97
|
FC_FILE: db "file", 0x0
|
76
|
98
|
;FC_SPACING: db "spacing", 0x0
|
77
|
99
|
;FC_LANG: db "lang", 0x0
|
|
100
|
+ teststr: db "0123456789ABCDEF", 0x0
|
78
|
101
|
|
79
|
102
|
section .bss
|
80
|
103
|
|
|
@@ -110,7 +133,9 @@ section .bss
|
110
|
133
|
.rd: resd 1
|
111
|
134
|
.wr: resd 1
|
112
|
135
|
|
|
136
|
+ ; visu_* are SDL stuff
|
113
|
137
|
visu_data_buff: resb 0x100
|
|
138
|
+ visu_data_sz: resq 1
|
114
|
139
|
|
115
|
140
|
%ifdef SDL2
|
116
|
141
|
visu_win: resq 1
|
|
@@ -122,18 +147,20 @@ section .bss
|
122
|
147
|
|
123
|
148
|
text_surf: resq 1
|
124
|
149
|
|
|
150
|
+ ; ttf_* are SDL_ttf stuff
|
125
|
151
|
ttf_font: resq 1
|
126
|
152
|
|
127
|
153
|
ttf_font_surf: resq 1
|
128
|
154
|
|
129
|
155
|
sdl_color: resd 1
|
130
|
156
|
|
131
|
|
- fc_config: resq 1
|
132
|
|
- fc_pattern: resq 1
|
133
|
|
- fc_object_set: resq 1
|
134
|
|
- fc_font_set: resq 1
|
135
|
|
- fc_font_file_ptr: resq 1
|
136
|
|
- fc_result: resd 1
|
|
157
|
+ ; fc_* are fontconfig stuff
|
|
158
|
+ fc_config: resq 1 ; ptr on FcConfig
|
|
159
|
+ fc_pattern: resq 1 ; ptr on FcPatter
|
|
160
|
+ fc_object_set: resq 1 ; object set (listing wanted property)
|
|
161
|
+ fc_font_set: resq 1 ; font set (when listing fonts)
|
|
162
|
+ fc_font_file_ptr: resq 1 ; pointer on filename ptr
|
|
163
|
+ fc_result: resd 1 ; an FcResult memory space
|
137
|
164
|
|
138
|
165
|
section .text
|
139
|
166
|
global _start
|
|
@@ -480,6 +507,9 @@ sdl_init:
|
480
|
507
|
; RAZ surface & blit
|
481
|
508
|
;call clear_screen ;useless
|
482
|
509
|
|
|
510
|
+ ;
|
|
511
|
+ ; Print glitch name in window (left for further utilisation)
|
|
512
|
+ ;
|
483
|
513
|
|
484
|
514
|
; init fontconfig
|
485
|
515
|
call FcInitLoadConfigAndFonts
|
|
@@ -527,7 +557,8 @@ dbg:
|
527
|
557
|
|
528
|
558
|
mov dword [sdl_color], 0xFFFFFFFF
|
529
|
559
|
mov rdi, [ttf_font]
|
530
|
|
- mov rsi, glitch_name
|
|
560
|
+ ;mov rsi, glitch_name
|
|
561
|
+ mov rsi, teststr
|
531
|
562
|
mov rdx, [sdl_color]
|
532
|
563
|
call TTF_RenderText_Solid ; render text in surface
|
533
|
564
|
mov [ttf_font_surf], rax
|
|
@@ -563,7 +594,7 @@ loop_event:
|
563
|
594
|
evt: ; not exit event
|
564
|
595
|
|
565
|
596
|
|
566
|
|
-visu:
|
|
597
|
+visu_upd:
|
567
|
598
|
; starts by reading from IPC pipe
|
568
|
599
|
xor rax, rax ; sys_read
|
569
|
600
|
xor rdi, rdi
|
|
@@ -573,6 +604,40 @@ visu:
|
573
|
604
|
syscall
|
574
|
605
|
cmp rax, -1
|
575
|
606
|
je exit_fatal
|
|
607
|
+ test rax, rax
|
|
608
|
+ jz loop_event ; no data in pipe, loop again
|
|
609
|
+ ; datas in pipe, updating screen
|
|
610
|
+ mov [visu_data_sz], rax
|
|
611
|
+
|
|
612
|
+ mov rdi, [visu_surf]
|
|
613
|
+ push rdi
|
|
614
|
+ call SDL_LockSurface
|
|
615
|
+
|
|
616
|
+ pushf
|
|
617
|
+ mov rsi, [rsp]
|
|
618
|
+ xor rcx, rcx
|
|
619
|
+ mov ecx, [rsi+16] ; surf_w
|
|
620
|
+ push rcx
|
|
621
|
+ dec qword [rsp] ; surf_w - 1, droping last colon
|
|
622
|
+ xor rax, rax
|
|
623
|
+ xor rdx, rdx
|
|
624
|
+ mov eax, [rsi+24] ; surf_pitch
|
|
625
|
+ mul ecx
|
|
626
|
+ mov rdx, rax ; line size in bytes
|
|
627
|
+
|
|
628
|
+ mov rsi, [rsi+32] ; surf_pixels
|
|
629
|
+ mov rcx, [rsp] ; surf_w - 1
|
|
630
|
+ add rsi, [rsp]
|
|
631
|
+ mov rdi, rsi
|
|
632
|
+ inc rdi ; destination is last colon
|
|
633
|
+ push rdi
|
|
634
|
+ mov rsi, [visu_data_buff]
|
|
635
|
+ .loop_shift:
|
|
636
|
+ mov rcx, 0xFF ; shift all 0xff pixels on colons
|
|
637
|
+
|
|
638
|
+ pop rdi
|
|
639
|
+ pop rcx
|
|
640
|
+ popf
|
576
|
641
|
|
577
|
642
|
jmp loop_event ; loop again
|
578
|
643
|
|