flat assembler
Message board for the users of flat assembler.
Index
> Linux > tryed to port "you massive clod" demo Goto page 1, 2 Next |
Author |
|
revolution 26 May 2022, 11:24
Searching for "you massive clod" on DDG turns up only this thread for me.
What is the "you massive clod" demo? |
|||
26 May 2022, 11:24 |
|
bitRAKE 26 May 2022, 12:57
_________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
26 May 2022, 12:57 |
|
revolution 26 May 2022, 15:38
Okay, thanks bitRAKE. DDG is a bit crap.
ProMiNick: Does this code work? Are you asking for assistance? I can't try it here. But it looks interesting. |
|||
26 May 2022, 15:38 |
|
ProMiNick 26 May 2022, 16:54
thanks revolution. someone already helped me to extract elf from form they packed in sh (with 7zip). By the way even exctracted elf not launched in my linux VM environment.
not test4 - as my port to fasm, not clod-windowed - unpacked sh are both segmentation fault. for comparison couple of successfuly executed between them
_________________ I don`t like to refer by "you" to one person. My soul requires acronim "thou" instead. |
||||||||||
26 May 2022, 16:54 |
|
revolution 27 May 2022, 04:42
My system doesn't have any library with SDL or GL in the name. So even if I could run arbitrary exe files any attempt to run it would fail with a missing library error.
Code: ~ find /lib* -name '*GL*' | wc 0 0 0 ~ find /lib* -name '*SDL*' | wc 0 0 0 ~ |
|||
27 May 2022, 04:42 |
|
ProMiNick 27 May 2022, 05:52
my linux environment has both but it not helps. Why? they present in some ubnormal form/place? Why demo dosn`t launch even official one? may be linux requirement from times that it was published was changed?
_________________ I don`t like to refer by "you" to one person. My soul requires acronim "thou" instead. |
||||||||||
27 May 2022, 05:52 |
|
Furs 27 May 2022, 13:19
revolution wrote: My system doesn't have any library with SDL or GL in the name. So even if I could run arbitrary exe files any attempt to run it would fail with a missing library error. /lib is for very few very essential libraries, in case of emergencies where rest of system isn't available (e.g. recovery console). Same with /bin. |
|||
27 May 2022, 13:19 |
|
revolution 27 May 2022, 13:42
You are correct.
Code: ~ find /usr/lib* -name '*GL*' | wc 51 51 2518 ~ find /usr/lib* -name '*SDL*' | wc 21 21 919 ~ |
|||
27 May 2022, 13:42 |
|
revolution 27 May 2022, 13:46
Oops, I take that back. I only have a 64-bit version for SDL.
Code: ~ find /usr -name 'libSDL-1.2.so.0' /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0 ~ find /usr -name 'libGL.so.1' /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/mesa/libGL.so.1 |
|||
27 May 2022, 13:46 |
|
revolution 27 May 2022, 17:13
Someone has pointed out to me that the shader is probably failing to compile because of an implicit type conversion failure.
The suggestion is to change this in two places: Code: From: if(f(o+d*t)<0) ; <--- integer 0 will fail To: if(f(o+d*t)<0.0) ; <--- make this a float value 0.0 |
|||
27 May 2022, 17:13 |
|
macomics 27 May 2022, 17:23
Code: ; From sub 0x3FF00000, 0 jl lower ; To fsub 0x3FF00000, 0.0 jl lower |
|||
27 May 2022, 17:23 |
|
ProMiNick 27 May 2022, 21:46
or mem(0x3FF00000),0
js lower test REG,REG js lower would be more universal for sign check - works for int & float both sad that shader in C code and not in assembly. Is shader could raise segmentation fault? |
|||
27 May 2022, 21:46 |
|
macomics 27 May 2022, 22:28
Only I just took into account the features of the C code generator and gave an example not of an assembler sequence, but clearly wanted to demonstrate the difference in comparisons generated by the C compiler.
Agree that the implementation of sub (integer subtraction) and fsub (real subtraction) operations are different. The constants 0x3FF00000 demonstrate the result of the f function - float. And 0 and 0.0 are constants from the conditions. With an integer comparison, it turns out that the range of values (-1; 1) will be equal to 0, and the result will be incorrect. |
|||
27 May 2022, 22:28 |
|
revolution 29 May 2022, 06:20
This is a 64-bit conversion. It assembles, but I can't test it.
I changed the shader code a small amount. I couldn't see how the z-based rotation as shown in the screen shot would be possible with the shader as given. Anyhow, if it all goes badly, you can change it back to the original. I included error checking at each main stage. It should also allow you to see the log of errors if the shader won't compile. Instead of blindly spinning through the code and assuming it all works you at least get a chance to diagnose the problem. If you want full screen then just put in a command line argument, it can be anything. No argument will give a windowed display. Code: x_res = 640 y_res = 480 buffer_size = 2000 SDL_INIT_VIDEO = 0x20 SDL_OPENGL = 0x00000002 SDL_FULLSCREEN = 0x80000000 SDL_KEYDOWN = 2 GL_FRAGMENT_SHADER = 0x8b30 GL_NO_ERROR = 0 format ELF64 executable 3 entry start segment gnustack segment executable functions equ macro invoke proc, [arg] { common regs equ rdi, rsi, rdx, rcx, r8, r9, -, - if ~ arg eq forward match reg =, shift, regs \{ regs equ shift if ~ reg eq arg mov reg, arg end if \} common end if call [proc] found equ 0 match a =proc b,x functions y \{ found equ 1 \} match =0, found \{ functions equ functions, proc \} } start: invoke SDL_Init,SDL_INIT_VIDEO test rax,rax mov ebp,1 jnz .err mov rbx,SDL_OPENGL cmp qword[rsp],1 ;full screen? jbe .set_mode mov rbx,SDL_OPENGL or SDL_FULLSCREEN invoke SDL_ShowCursor,0 .set_mode: invoke SDL_SetVideoMode,x_res,y_res,0,rbx test rax,rax mov ebp,2 jz .err invoke glCreateProgram test rax,rax mov ebp,3 jz .err mov r15,rax ;r15 = program invoke glCreateShader,GL_FRAGMENT_SHADER test rax,rax mov ebp,4 jz .err mov r14,rax ;r14 = shader lea rbx,[fragment_shader_source] push rbx invoke glShaderSource,r14,1,rsp,0 pop rbx invoke glGetError cmp rax,GL_NO_ERROR mov ebp,5 jnz .err invoke glCompileShader,r14 invoke glGetError cmp rax,GL_NO_ERROR mov ebp,6 jnz .err call .shader_log invoke glAttachShader,r15,r14 invoke glGetError cmp rax,GL_NO_ERROR mov ebp,7 jnz .err invoke glLinkProgram,r15 invoke glGetError cmp rax,GL_NO_ERROR mov ebp,8 jnz .err call .program_log invoke glUseProgram,r15 invoke glGetError cmp rax,GL_NO_ERROR mov ebp,9 jnz .err lea rsi,[WindowSize] invoke glGetUniformLocation,r15,rsi mov r13,rax ;r13 = WindowSize invoke glGetError cmp rax,GL_NO_ERROR mov ebp,10 jnz .err invoke glUniform2i,r13,x_res,y_res invoke glGetError cmp rax,GL_NO_ERROR mov ebp,11 jnz .err .loop: invoke SDL_GetTicks push rax invoke glColor4ubv,rsp pop rax invoke glGetError cmp rax,GL_NO_ERROR mov ebp,12 jnz .err invoke glRecti,-1,-1,1,1 invoke glGetError cmp rax,GL_NO_ERROR mov ebp,13 jnz .err invoke SDL_GL_SwapBuffers .get_event: lea rdi,[sdlevent] invoke SDL_PollEvent,rdi test al,al jz .loop cmp byte[sdlevent],SDL_KEYDOWN ;event.type jne .get_event xor ebp,ebp .quit: cmp qword[rsp],1 ;full screen? jbe .close invoke SDL_ShowCursor,1 .close: invoke SDL_Quit mov eax,SYS_EXIT mov edi,ebp syscall .err: call print_hex mov eax,ebp call print_hex jmp .quit .program_log: lea rdx,[sdlevent] lea rcx,[sdlevent+8] invoke glGetProgramInfoLog,r15,buffer_size,rdx,rcx jmp .log .shader_log: lea rdx,[sdlevent] lea rcx,[sdlevent+8] invoke glGetShaderInfoLog,r14,buffer_size,rdx,rcx .log: mov rdx,qword[sdlevent] test rdx,rdx jz .ret lea rsi,[sdlevent+8] mov eax,SYS_WRITE mov edi,STD_OUTPUT syscall pop rax jmp .quit .ret: ret print_hex: sub rsp,28 mov rsi,rsp call write_hex mov byte[rsi],10 lea rdx,[rsi+1] mov rsi,rsp sub rdx,rsi mov eax,SYS_WRITE mov edi,STD_OUTPUT syscall add rsp,28 ret write_hex: ;rsi = address ;rax = value mov ecx,15 .next_nibble: mov edx,eax and edx,0xf mov dl,[hex_table+rdx] mov [rsi+rcx],dl shr rax,4 dec ecx jns .next_nibble add rsi,16 ret db (-$) and 7 dup 0 SYS_WRITE = 1 SYS_EXIT = 60 STD_OUTPUT = 1 DT_NULL = 0 DT_NEEDED = 1 DT_STRTAB = 5 DT_SYMTAB = 6 DT_RELA = 7 DT_RELASZ = 8 DT_RELAENT = 9 DT_STRSZ = 10 DT_SYMENT = 11 DT_BIND_NOW = 24 DT_FLAGS = 30 DT_FLAGS_1 = 0x6ffffffb STB_GLOBAL = 1 STT_FUNC = 2 R_X86_64_64 = 1 DF_BIND_NOW = 0x00000008 DF_1_NOW = 0x00000001 DF_1_PIE = 0x08000000 macro Elf64_Sym name,value,size,bind,type,other,shndx { dd name+0 db (bind+0) shl 4 + (type+0) db other+0 dw shndx+0 dq value+0 dq size+0 } macro Elf64_Rela offset,symbol,type,addend { dq rva offset+0 dq (symbol+0) shl 32 + (type+0) dq addend+0 } virtual at 0 Elf64_Sym sizeof.Elf64_Sym = $ Elf64_Rela sizeof.Elf64_Rela = $ - sizeof.Elf64_Sym end virtual segment dynamic readable dq DT_NEEDED,_sdl - strtab dq DT_NEEDED,_gl - strtab dq DT_STRTAB,rva strtab dq DT_STRSZ,strsz dq DT_SYMTAB,rva symtab dq DT_SYMENT,sizeof.Elf64_Sym dq DT_RELA,rva rela dq DT_RELASZ,relasz dq DT_RELAENT,sizeof.Elf64_Rela dq DT_BIND_NOW,1 dq DT_FLAGS,DF_BIND_NOW dq DT_FLAGS_1,DF_1_NOW or DF_1_PIE dq DT_NULL,0 symtab: Elf64_Sym match =,funcs,functions { irp f,funcs \{ if used f Elf64_Sym _\#f - strtab,0,0,STB_GLOBAL,STT_FUNC,0,0 end if \}} rela: num = 1 match =,funcs,functions { irp f,funcs \{ if used f Elf64_Rela f,num,R_X86_64_64 num = num + 1 end if \}} relasz = $ - rela match =,funcs,functions { irp f,funcs \{ if used f f rq 1 end if \}} segment interpreter readable db '/lib64/ld-linux-x86-64.so.2' strtab: db 0 _sdl db 'libSDL-1.2.so.0',0 _gl db 'libGL.so.1',0 match =,funcs,functions { irp f,funcs \{ if used f _\#f db \`f,0 end if \}} strsz = $ - strtab segment readable writeable hex_table db '0123456789abcdef' WindowSize db "WindowSize",0 fragment_shader_source: db "uniform ivec2 WindowSize;" db "float f(vec3 o){" db "float a=sin(o.z)*.3927,s=sin(a),c=cos(a);" ; pi/8 ~= 0.3927 db "o=cos(vec3(c*o.x-s*o.y,s*o.x+c*o.y,o.z));" db "return dot(o,o)-1.2;" db "}" db "vec3 s(vec3 o,vec3 d){" db "float t=0.,a,b;" db "for(int i=0;i<75;i++){" db "if(f(o+d*t)<.0){" db "a=t-.125;b=t;" db "for(int i=0;i<10;i++){" db "t=(a+b)*.5;" db "if(f(o+d*t)<.0)b=t;else a=t;" db "}" db "vec3 e=vec3(.1,0,0)," db "p=o+d*t," db "n=normalize(vec3(f(p+e),f(p+e.yxy),f(p+e.yyx))+sin(p*75.)*.01);" db "return mix(((max(dot(n,vec3(.577)),0.)+0.125*max(dot(n,vec3(-.707,-.707,0.)),0.)))*(mod(length(p.xy)*20.,2.)" db "<1.0?vec3(.71,.85,.25):vec3(.79,.93,.4))" db ",vec3(.93,.94,.85),vec3(pow(t*0.111,5.))" db ");" db "}" db "t+=.125;" db "}" db "return vec3(.93,.94,.85);" db "}" db "void main(){" db "vec2 hws=vec2(WindowSize)*.5;" db "float t=dot(gl_Color.xyz,vec3(1,256,65536))*.5;" db "gl_FragColor=vec4(s(vec3(sin(t*1.5)*.5,cos(t)*.5,t),normalize(vec3(gl_FragCoord.xy-hws,hws.x))),1);" db "}",0 align 8 sdlevent rb buffer_size |
|||
29 May 2022, 06:20 |
|
revolution 26 Jun 2022, 15:40
It is possible to make a 64-bit version also that is under 1K. Using the standard fasm elf formatter without any special tricks the interpreter header can be eliminated, leaving just two: the LOAD and DYNAMIC headers.
When combined with a small amount of abuse in the dynamic header, and the external zcat, the final executable is 1019 bytes. Instructions for making are in the first line. Code: ;fasm clod64.asm clod64 && (echo 'a=/tmp/I;tail -n+2 $0|zcat>$a;chmod +x $a;$a;rm $a;exit' ; gzip -9 < clod64) > clod && chmod +x clod && ./clod ;output size is 1019 bytes check_errors = 0 half_x_res equ 320 half_y_res equ 240 buffer_size = 2000 ;Versions ;OpenGL GLSL ;2.0 1.10 <--- this code ;2.1 1.20 ;3.0 1.30 ;3.1 1.40 ;3.2 1.50 ;3.3 3.30 SDL_INIT_VIDEO = 0x20 SDL_OPENGL = 0x00000002 SDL_KEYDOWN = 2 SDL_QUIT = 12 GL_FRAGMENT_SHADER = 0x8b30 GL_COMPILE_STATUS = 0x8b81 GL_VALIDATE_STATUS = 0x8b83 GL_NO_ERROR = 0 GL_FALSE = 0 SYS_WRITE = 1 SYS_EXECVE = 59 SYS_EXIT = 60 STD_OUTPUT = 1 DT_NULL = 0 DT_NEEDED = 1 DT_STRTAB = 5 DT_SYMTAB = 6 DT_DEBUG = 21 DT_GNU_HASH = 0x6ffffef5 functions equ macro invoke proc, [arg] { common regr equ rdi, rsi, rdx, rcx, r8, r9, -, - rege equ edi, esi, edx, ecx, r8d, r9d, -, - if ~ arg eq forward match rreg =, shiftr =| ereg =, shifte, regr | rege \{ regr equ shiftr rege equ shifte if arg eqtype 0 & 0 = arg xor ereg, ereg else if arg eqtype 0 & 0x80 > arg & -0x80 <= arg push arg pop rreg else if arg eqtype 0 & 1 shl 32 > arg & 0 <= arg mov ereg, arg else if ~ rreg eq arg if arg in <rax,rbx,rcx,rdx,rsi,rdi,rbp,rsp> push arg pop rreg else mov rreg, arg end if end if \} common end if call [rbp+proc-procs] found equ 0 match a =proc b,x functions y \{ found equ 1 \} match =0, found \{ functions equ functions, proc \} } ; invoke with error check macro einvoke proc, [arg] { common local .okay, .proc_name invoke proc,arg if check_errors invoke glGetError assert GL_NO_ERROR = 0 test rax,rax jz .okay push rax mov edx,.okay - .proc_name lea esi,[.proc_name] push STD_OUTPUT SYS_WRITE pop rax rdi syscall pop rax jmp error .proc_name: db `proc,10 .okay: end if } ; invoke with return value check macro rinvoke proc, [arg] { common local .okay, .proc_name invoke proc,arg if check_errors test rax,rax jnz .okay push rax mov edx,.okay - .proc_name lea esi,[.proc_name] push STD_OUTPUT SYS_WRITE pop rax rdi syscall pop rax jmp error .proc_name: db `proc,10 .okay: end if } virtual org 0 struc r_debug { .r_version rq 1 ; version number for this protocol .r_map rq 1 ; head of the chain of loaded objects .r_brk rq 1 ; breakpoint for debugger to monitor .so mapping changes .r_state rq 1 ; object mapping state .r_ldbase rq 1 ; base address the linker is loaded at }r_debug r_debug org 0 struc link_map { .l_addr rq 1 ; library load address .l_name rq 1 ; file name of library .l_ld rq 1 ; dynamic section of library .l_next rq 1 ; next in chain .l_prev rq 1 ; previous in chain }link_map link_map org 0 struc gnu_hash { .bucket_count rd 1 .symbol_offset rd 1 .bloom_size rd 1 .bloom_shift rd 1 .bucket_list rb 0 }gnu_hash gnu_hash org 0 struc Elf64_Sym { .st_name rd 1 .st_info rb 1 .st_other rb 1 .st_shndx rw 1 .st_value rq 1 .st_size rq 1 }Elf64_Sym Elf64_Sym sizeof.Elf64_Sym = $ end virtual format ELF64 executable 3 at 0x10000 entry begin segment dynamic dq DT_NEEDED,GL - $$ dq DT_NEEDED,SDL - $$ dq DT_STRTAB,rva $$ dq DT_DEBUG dt_debug dq ? dq DT_SYMTAB;,0 ;dq DT_NULL,0 interpret: mov al,SYS_EXECVE assert procs = interpreter push rsp rbp pop rdi rsi rdx push rdi segment readable writeable executable lea rdx,[rsi+(rdx+2)*8] syscall if check_errors jmp link_quit end if begin: mov ebp,procs push proc_count-1 pop r13 push [dt_debug] .link_loop: pop rax test rax,rax jz interpret mov rdi,[rax+r_debug.r_map] push rax .library_loop: mov rsi,[rdi+link_map.l_name] cmp byte[rsi],0 jz .next_library mov rsi,[rdi+link_map.l_ld] ; rsi = dynamic section .find_tables_loop: lodsq cmp eax,DT_GNU_HASH cmovz rbx,[rsi] ; rbx = gnu hash table cmp eax,DT_SYMTAB cmovz r14,[rsi] ; r14 = symbol table test eax,eax lodsq jnz .find_tables_loop xchg edx,eax ; rdx = 0 mov eax,[rbp+r13*4-procs+hashes] mov ecx,[rbx+gnu_hash.bucket_count] ; rcx = bucket count div ecx ; rdx = target bucket mov eax,[rbx+gnu_hash.bloom_size] lea rax,[rbx+rax*8+gnu_hash.bucket_list] ; rax = bucket list lea rcx,[rax+rcx*4] ; rcx = hash chains mov edx,[rax+rdx*4] ; rdx = chain/symbol index sub edx,[rbx+gnu_hash.symbol_offset] ; adjust symbol offset jb .next_library .find_symbol_loop: mov eax,[rbp+r13*4-procs+hashes] mov esi,[rcx+rdx*4] xor eax,esi shr eax,1 jz .found_symbol inc edx shr esi,1 ; bit 0 = set, marks the end of the chain jnc .find_symbol_loop .next_library: mov rdi,[rdi+link_map.l_next] if check_errors test rdi,rdi jnz .library_loop jmp link_quit else jmp .library_loop end if .found_symbol: add edx,[rbx+gnu_hash.symbol_offset] imul edx,edx,sizeof.Elf64_Sym mov rax,[r14+rdx+Elf64_Sym.st_value] add rax,[rdi+link_map.l_addr] mov [rbp+r13*8-procs+hashes],rax dec r13 jns .link_loop ; invoke SDL_Init,SDL_INIT_VIDEO if check_errors test rax,rax jnz error end if rinvoke SDL_SetVideoMode,half_x_res * 2,half_y_res * 2,0,SDL_OPENGL rinvoke glCreateProgram push rax ; [rsp] = program rinvoke glCreateShader,GL_FRAGMENT_SHADER xchg rdi,rax push rdi ; [rsp] = shader push shader einvoke glShaderSource,rdi,1,rsp,0 pop rax rdi push rdi einvoke glCompileShader,rdi if check_errors pop rdi push rdi call shader_log pop rdi push rdi push GL_FALSE invoke glGetShaderiv,rdi,GL_COMPILE_STATUS,rsp pop rax cmp rax,GL_FALSE jz error end if pop rsi rdi push rdi einvoke glAttachShader,rdi,rsi pop rdi push rdi einvoke glLinkProgram,rdi if check_errors pop rdi push rdi invoke glValidateProgram,rdi pop rdi push rdi call program_log pop rdi push rdi push GL_FALSE invoke glGetProgramiv,rdi,GL_VALIDATE_STATUS,rsp pop rax cmp rax,GL_FALSE jz error end if pop rdi push rdi ; not required, but gzip finds this favourable einvoke glUseProgram,rdi .animation_loop: invoke SDL_GetTicks push rax einvoke glColor4ubv,rsp pop rdi mov edx,edi neg edi einvoke glRecti,rdi,rdi,rdx,rdx invoke SDL_GL_SwapBuffers .get_event: lea edi,[rbp-procs+SDL_Event] invoke SDL_PollEvent,rdi test eax,eax jz .animation_loop mov al,[rbp-procs+SDL_Event] cmp al,SDL_QUIT je quit cmp al,SDL_KEYDOWN jne .get_event quit: invoke SDL_Quit xor edi,edi link_quit: push SYS_EXIT pop rax syscall if check_errors error: sub rsp,20 mov rsi,rsp push 15 pop rcx .next_nibble: mov edx,eax and edx,0xf mov dl,[hex_table+rdx] mov [rsi+rcx],dl shr rax,4 dec ecx jns .next_nibble mov byte[rsi+16],10 push STD_OUTPUT SYS_WRITE 17 pop rdx rax rdi syscall add rsp,20 jmp quit program_log: lea edx,[log_buffer] lea ecx,[rdx+8] push 0 pop qword[rdx] invoke glGetProgramInfoLog,rdi,buffer_size,rdx,rcx jmp log shader_log: lea edx,[log_buffer] lea ecx,[rdx+8] push 0 pop qword[rdx] invoke glGetShaderInfoLog,rdi,buffer_size,rdx,rcx log: mov rdx,qword[log_buffer] test rdx,rdx jz .ret lea esi,[log_buffer+8] push STD_OUTPUT SYS_WRITE pop rax rdi syscall .ret: ret end if shader: db "float f(vec3 o){" db "float a=sin(o.z)*.3927,s=sin(a),c=cos(a);" ; pi/8 ~= 0.3927 db "o=cos(vec3(cos(a)*o.x-sin(a)*o.y,sin(a)*o.x+cos(a)*o.y,o.z));" db "return dot(o,o)-1.2;" db "}" db "vec3 s(vec3 o,vec3 d){" db "float t=0.,a,b,z=t;" db "for(int i=0;i<75;i++){" db "if(f(o+d*t)<z){" db "a=t-.125;b=t;" db "for(int i=0;i<10;i++){" db "t=(a+b)*.5;" db "if(f(o+d*t)<z)b=t;else a=t;" db "}" db "vec3 e=vec3(.1,z,z)," db "p=o+d*t," db "n=normalize(vec3(f(p+e),f(p+e.yxy),f(p+e.yyx))+sin(p*75.)*.01);" db "return mix(((max(dot(n,vec3(.577)),z)+.125*max(dot(n,vec3(-.707,-.707,z)),z)))*" db "(mod(length(p.xy)*20.,2.)" db "<1.?vec3(.71,.85,.25):vec3(.79,.93,.4))" db ",vec3(.93,.94,.85),vec3(pow(t/9.,5.))" db ");" db "}" db "t+=.125;" db "}" db "return vec3(.93,.94,.85);" db "}" db "void main(){" db "float t=dot(gl_Color,vec4(1,256,65536,0))*.5;" db "gl_FragColor=vec4(s(vec3(sin(t*1.5)*.5,cos(t)*.5,t),normalize(vec3((gl_FragCoord.xy-" match hx hy, half_x_res half_y_res { db "vec2(",`hx,",",`hy,"))/vec2(",`hx,"),1))),1);" } db "}",0 if check_errors hex_table db '0123456789abcdef' end if hashes: match =,funcs,functions { irp f,funcs \{ if used f hash = 5381 virtual at 0 db \`f while % <= $ load c byte from % - 1 hash = (hash * 33 + c) and 0xffffffff end while end virtual label f qword at $ + $ - hashes dd hash end if \}} proc_count = ($ - hashes) shr 2 procs: interpreter: db '/lib64/ld-linux-x86-64.so.2',0 GL db 'libGL.so',0 SDL db 'libSDL.so' rb proc_count * 4 + procs - $ SDL_Event rb 8 SDL_key rb 1 if check_errors log_buffer rb buffer_size end if |
|||
26 Jun 2022, 15:40 |
|
sylware 27 Jun 2022, 00:40
you may consider a vulkan3D port, with a native spir-v shader.
|
|||
27 Jun 2022, 00:40 |
|
revolution 27 Jun 2022, 03:54
Perhaps one day. But there is currently less support for SPIR-V than GLSL
I am more interested in the ELF and assembly parts, then the shader HLL part. |
|||
27 Jun 2022, 03:54 |
|
FlierMate1 27 Jun 2022, 06:07
revolution wrote: This is a 64-bit conversion. It assembles, but I can't test it. It can compile, but it complained an error.
|
||||||||||||||||||||||||||||
27 Jun 2022, 06:07 |
|
revolution 27 Jun 2022, 06:41
What is your SDL called?
Code: ls /usr/lib/x86_64-linux-gnu/libSDL* |
|||
27 Jun 2022, 06:41 |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.