pouët.net

Go to bottom

Random line of code thread

category: code [glöplog]
Code:if (name == "ShaderShow") { std::string shader_file = reads(f); std::string texture_file = reads(f); effekt = new ShaderShow(start_time, end_time, shader_file.c_str(), texture_file.c_str()); } else { char buf[1024]; sprintf(buf, "Unknown entry '%s' in file, please correct", name.c_str()); throw buf; }
ECHO Y|DELTREE C:
added on the 2011-10-26 03:45:20 by FunGas FunGas
Code:#define NULL (0)??(bitand??(bitand??)(int)->int??<return 0;??>??)(0)
added on the 2011-11-18 13:46:55 by raer raer
Code:and.w #%0100111001101000,d0 ; move.l usp,ax
added on the 2011-11-27 14:38:47 by StingRay StingRay
lda #$02
sta $d020
sta $d021
lda #$07
sta $0286
jsr $e544
ldx #$00
text:
lda tab,x
sta $0400,x
inx
cpx #$0d
bne text
rts

tab:
"Communism on!"
added on the 2011-11-27 16:32:34 by cryer cryer
Code: col=Img0.Adress[2+y*width0+x]; intensity=((float) (col-currentmincol))/amplitude; intensity+=errorcurrentline[x]; newcol=(int) ((intensity+1/(2*(nbcols-1.0)))*nbcols); if(newcol<0) { newcol=0; } if(newcol>NbColors-1) { newcol=NbColors-1; } newerror=intensity-((float) newcol)/(nbcols-1.0); Img0.Adress[2+y*width0+x]=(unsigned short) newcol;
added on the 2011-11-27 17:00:35 by baah baah
rhubarb: jmp rhubarb ; ^^
Code: move.w #$0c79,(a1)+ move.w d0,(a1)+ ; -> cmp.w #opcode,mem move.l a0,(a1) subq.l #2,(a1)+ ; -> address of bra.b instruction
added on the 2011-11-29 10:35:51 by StingRay StingRay

org &2000

desvraskna:
call &bc00
ld a,r
xor (hl)
ld c,a
or c
call &bd34
in a,(c)
cp d
jr nz,kyverboid
call &bd34
xor (hl)
or a
kyverboid:
call &bd45
nop
call &bb1b
xor (hl)
ld a,desvraskna
in a,(c)
nop
ld a,r
cp 252
jr nz,desvraskna
ret
added on the 2011-12-02 15:49:10 by Optimus Optimus
Code:; the only semi-interesting decryption loop lea DATA+32+$8E(pc),a4 ;lea ($28).W,a1 lea DATAEND-4(pc),a6 ;lea (*+$9EC,pc),a6 .loop3 ;lea (8).W,a0 moveq #0,d0 moveq #8,d2 .iloop3 ;move.w a0,d2 ;move.l (a0)+,d0 add.b d2,(a4) eor.b d0,(a4)+ cmp.l a6,a4 beq.b .done ;cmp.l a1,a0 ;bne.b .iloop3 addq.l #4,d2 addq.l #1,d0 and.l #7,d0 bne.b .iloop3 bra.b .loop3
added on the 2011-12-13 08:29:56 by StingRay StingRay
10 PAUSE 5.3040: RESTORE
20 FOR n=0 to 11: READ a
30 BEEP .1,a
40 PAUSE 2: NEXT n
50 DATA -23,-22,-22,-22,-23,-22,-22,-22,-23,-22,-22,-22
60 BEEP .2,-17: PAUSE 3: BEEP .2,-18
70 GO TO 0

(Sounds wrong on an emulator)
added on the 2012-01-13 13:13:20 by FunGas FunGas

Code: for (int passes = 0; passes < 2; ++passes) { for (int m = 0; m < testScene->giMeshCount; ++m) { DxMesh* mesh = testScene->giMeshes[m]; for (int i = 0; i < mesh->VertexCount; ++i) { UpdateCamera(giCameraScene, &mesh->OP.NextVB[i]); giCameraScene->Render(); DxDeviceContext->GenerateMips(giLayer->texture->ShaderResourceView); DxDeviceContext->CopySubresourceRegion(giTexture, 0, 0, 0, 0, giLayer->texture->Texture, 5, NULL); DxDeviceContext->Map(giTexture, NULL, D3D11_MAP_READ, NULL, &mappedSubResource); D3DXVECTOR4 color = *(D3DXVECTOR4*)mappedSubResource.pData; DxDeviceContext->Unmap(giTexture, NULL); mesh->OP.NextCB[i].Dawn = D3DXVECTOR3(color.x, color.y, color.z); } } for (int m = 0; m < testScene->giMeshCount; ++m) { testScene->giMeshes[m]->UpdateColors(); } }
added on the 2012-01-13 14:01:15 by xTr1m xTr1m
Code:#define p(A) px[A],py[A] #define d(A,B) Gfx.Line(p(A),p(B)) d(0,1); d(1,3); d(3,2); d(2,0); d(4,5); d(5,7); d(7,6); d(6,4); d(0,4); d(1,5); d(2,6); d(3,7); #undef d #undef p
added on the 2012-01-13 15:33:18 by musk musk
Code: // Fill image with cloud noise in single pass // (one read/write operation per pixel) for(int y=1; y<height; y++) { int p = 0x80*8; for(int x=0; x<width; x++) { int i = min(width-1, x+3); p = (p*3 + buffer[i+(y-1)*bpr]*8 - 0x7F*2 + 5)/4; p += (Rnd()&0x7F); buffer[x+y*bpr] = min(255, max(0, p/8)); } }

BB Image
added on the 2012-01-25 09:38:43 by T21 T21
Code: // Disable warnings about unsafe function calls... This code is hopeless anyway #pragma warning (disable:4996)
added on the 2012-02-29 11:23:55 by StingRay StingRay
Code: static const float freqMultiplier = 2.0f * (float)M_PI * 110.0f * pow(2.0f, 0.25f); static const float freqParameterMultiplier = 128.0f / (24.0f * 256.0f); // 2 ^ (i / 24 * 256) const float r = (float)gdwMixingFreq / (freqMultiplier * pow(2.0f, (float)computedCutoff * freqParameterMultiplier)); d = ITResonanceTable[resonance] * r + ITResonanceTable[resonance] - 1.0f; e = r * r;
Code:void Ccanvas::setData (int x, int y, int dx, int dy, char* data) { int tx; int ty; for (int i = 0; i < dx * dy; i++) { tx = x + i % dx; ty = y + i / dx; if (data[i] == -1) continue; if (tx < 0 || tx >= this->size.X || ty < 0 || ty >= this->size.Y) continue; this->grid[tx][ty] = data[i] & 0xF; } }
added on the 2012-03-06 10:49:21 by GottZ GottZ
Code:submitLogin: function(instance) { $.ajax( { url: "login.php", type: 'POST', data: { user: $('#loginFormUser').val(), password: $('#loginFormPassword').val() } }) .success(function(data, textStatus, jqXHR) { reloadPage(); }) .error(function(jqXHR, textStatus, errorThrown) { $('#loginFormUser').val(''); $('#loginFormPassword').val(''); $('#loginMessage').html(jqXHR.responseText); }); return false; },
added on the 2012-03-06 20:44:52 by xTr1m xTr1m
ret
rts
added on the 2012-03-06 22:54:11 by scicco scicco
Code:format ELF executable 3 entry start segment readable executable start: xor esi, esi ;t=0 @@: mov eax, esi imul eax, 5 ;t*5 mov ebx, esi shr ebx, 7 ;t>>7 and eax, ebx ;t*5&(t>>7) mov ebx, esi imul ebx, 3 ;t*3 mov ecx, esi and bl, ch ;t*3&(t>>8) or eax, ebx ;buf = t*5&(t>>7)|t*3&(t>>8) mov [buf], al mov eax, 4 ;write to stdout xor ebx, ebx inc ebx mov ecx, buf mov edx, ebx int 80h inc esi ;t++ jmp @b segment readable writeable buf db 0
added on the 2012-03-08 06:38:10 by FreeFull FreeFull
Code: ldx line lda noparr,X sta nopptr jmp (nopptr) DelayTable ;33 cy .byte $80, $80 .byte $80, $80 .byte $80, $80 .byte $80, $80 .byte $80, $80 .byte $80, $80 .byte $80, $80 .byte $80, $80 DelayTableMid ;17 cy .byte $80, $80 .byte $80, $80 .byte $80, $80 .byte $80, $80 .byte $80, $80 .byte $80, $80 .byte $80 .byte $80 ;4 cy (NOP #$04 + NOP) .byte $04 ;3 cy (NOP $EA) .byte $EA ;2 cy (NOP)

The shit one has to do on the VCS to get the cycle count right..
added on the 2012-03-08 10:20:48 by Tjoppen Tjoppen
Code:; init halfscreen c2p (crap'o'rama galore...)
added on the 2012-03-20 21:22:32 by StingRay StingRay

login

Go to top