pouët.net

Go to bottom

Random line of code thread

category: code [glöplog]
Code:pub fn tiles(&self) -> impl Iterator<Item = (usize, usize, &Tile)> { let width = self.width; self.tiles .iter() .enumerate() .map(move |(i, tile)| (i % width, i / width, tile)) }
added on the 2018-06-29 00:50:45 by FreeFull FreeFull
Code:lea ecx, [ebp+__strempty-__self+EBP_bias] ; Elf32_Header.e_entry[0] add bl, bl ; e_entry[1], e_entry[2] db 0xEB ; e_entry[3]
added on the 2018-06-29 02:17:17 by porocyon porocyon
... and 0xEB is the first half of a jmp
added on the 2018-06-29 02:18:00 by porocyon porocyon
Code:const char* iEmojiAtlas[]={ "🔴", "😡", "🤗", "🌕", "🎾", "🤢", "🌎", "🔵", "😈", "🍇", "⚪", "🌕", "😡", "🍇", "😈", "🌑", "🏿", "🏾", "🏽", "🏼", "🏻", "🌑", "🌒", "🌓", "🌔", "🌕", "🌖", "🌗", "🌘", "⚫", "🔘", "⚪", " ", "💮", "⭕", "🔴", " ", "🔸", "🌕", "⬜", "📕", "📙", "📒", "📗", "📘", " ", " ", " ", " ", " ", " ", " ", " ", "😈", "💖", "🌸", "🍀", "🥦", "🎛", "🗑", "🌐", "🎽", "🔵", "🌞", };
added on the 2018-06-29 02:35:47 by yx yx
^^ This code is Art in itself! ^^
Code: ;$40=010 00 000 $58=0101 10 00 ;$48=010 01 000 $59=0101 10 01 ;$50=010 10 000 $5A=0101 10 10 ;[draw attributes] ld l,e ld a,d and %00011000 srl a srl a srl a add a,$58 ld h,a
added on the 2018-06-29 16:35:02 by g0blinish g0blinish
Code:move.w #$51c8,4(a4) ; add fake dbf so our "search for end opcode" routine will work
added on the 2018-07-12 10:41:26 by StingRay StingRay
Code:mov dx,0f2fh
Code:move.l (a7),a7 ; head hurts!
added on the 2018-07-15 15:15:02 by StingRay StingRay
Code: if (pause) { btime = time - atime; } else { atime = time - btime; }
added on the 2018-07-19 23:14:30 by Optimus Optimus
Code:bsamp_prepUVs(curX, curY, kMapAnd, kMapShift, U0, V0, U1, V1, fracU, fracV);
added on the 2018-07-19 23:25:32 by superplek superplek
too complic!
just make it all global!
"static float curX, curY, kMapAnd, kMapShift, U0, V0, U1, V1, fracU, fracV;"
Oh, you do GLSL... :p
it's an inline integer SSE function call
added on the 2018-07-19 23:44:44 by superplek superplek
Code:<svg onload=for(i=32640;i--;)write(i%255?i/128&i?'_':'#':'\n')>

spoiler (because pouet fucks this up)
added on the 2018-07-20 11:12:18 by HellMood HellMood
Code:bool doCompression = m_useTinyHeader || m_compressionType != COMPRESSION_INSTANT && !(reuseType == REUSE_STABLE && reuse != nullptr);
added on the 2018-07-22 14:50:19 by Blueberry Blueberry
Code: inline int IsVoid() const { return int(m_indexBits+m_wordIdx)>>31; } // Is 1 (sign bit) if zero children (0) and no word (-1).
added on the 2018-07-24 12:24:53 by superplek superplek
.done:
// Stream samples from S-CPU
ldw {CPU0} // 5 left
stw 0 // 5
str {CPU3}=#$80 // 5 acknowledge
ldw {CPU2} // 5 right
str {CPU3}=#0 // 5 clear acknowledge
stw 2 // 5

ldw {CPU0} // 5 left
stw 0 // 5
str {CPU3}=#$80 // 5 acknowledge
ldw {CPU2} // 5 right
str {CPU3}=#0 // 5 clear acknowledge
stw 2 // 5
bra .done // 4
added on the 2018-07-25 16:49:07 by Molive Molive
Code: const __m128i additive = c2vISSE(bsamp32(U, V, s_pEnvMap)); color = _mm_adds_epu16(color, additive);
added on the 2018-07-27 12:50:08 by superplek superplek
// ckd//bevacqua -- old school 2x2 & 4x4 map interpolation blitters plus buffers to use (for heavier effects)
added on the 2018-07-30 01:13:36 by superplek superplek
Code:/*failed - normal colored sphere*/ float scenesdf(vec3 position) { return length(position)-60.0; } vec3 raydirection(float fov,vec2 pxposition,vec2 size) { float viewdistance = abs((size.y/2.0)/tan(radians(fov/2.0))); vec3 raypredir = vec3 (pxposition-size/2.0,-viewdistance); return normalize(raypredir); } float raydistance(int Mstep,float Mval,float error,vec3 direction,vec2 coord,vec3 eye) { vec3 predir; predir = vec3(coord,0.0)+vec3(eye); float returndepth; for(int i = 0;i < Mstep;i++) { if(scenesdf(predir) < 0.0) { return Mval; } else { if(scenesdf(predir) < error) { return length(predir); } else { predir = scenesdf(predir) * direction + eye; returndepth = length(predir); } } if(returndepth > Mval) { returndepth = Mval; return returndepth; } } return returndepth; } vec3 normaldir(vec3 point,float error,float Mval) { vec3 returndir; if(length(point) < Mval - error) { returndir = vec3( (scenesdf(vec3(point.x + error,point.y,point.z)) - scenesdf(vec3(point.x - error,point.y,point.z))), (scenesdf(vec3(point.x,point.y + error,point.z)) - scenesdf(vec3(point.x,point.y - error,point.z))), (scenesdf(vec3(point.x,point.y,point.z + error)) - scenesdf(vec3(point.x,point.y,point.z - error))) ); } else { return vec3(0.0,0.0,0.0); } return normalize(returndir); } void mainImage( out vec4 fragColor, in vec2 fragCoord ) { vec3 eye = vec3(0.0,0.0,62.0); vec3 raydir = raydirection(90.0,vec2(fragCoord),vec2(iResolution)); float depth = raydistance(256,1000.0,0.001,raydir,vec2(iResolution),vec3(eye)); vec3 norm = normaldir(vec3(raydir * depth),0.001,1000.0); fragColor = vec4(norm,1.0); }
added on the 2018-08-11 15:21:47 by pitapoto pitapoto
Quote:
Random line of code thread


Quote:
line of code


Quote:
line
added on the 2018-08-11 17:52:23 by porocyon porocyon
Code:mov ah,12
Oh -
Sorry for too many lines..
added on the 2018-08-11 17:55:31 by pitapoto pitapoto
divu #61237,d0 ;)
added on the 2018-08-12 01:54:37 by Photon Photon
Code: jsr (d0.l)
added on the 2018-08-30 16:32:17 by StingRay StingRay

login

Go to top