pouët.net

Go to bottom

Random line of code thread

category: code [glöplog]
Code:sta $D400,y
added on the 2020-05-16 22:25:56 by Blueberry Blueberry
hlt ; some random padding (free space ftw!)
added on the 2020-05-18 12:22:35 by superogue superogue
wait: jp nc, wait
added on the 2020-05-18 17:34:40 by neon neon
Code:aam 0xDE ; greetings to all my german friends ;-)
added on the 2020-05-18 19:09:25 by superogue superogue
Code:func cos {+ -11 sin}
added on the 2020-05-19 11:31:57 by ltipl ltipl
Code:jc doloop ; 2 first iteration -> next bit js done ; 2 op completed, store it and copy the next literal jp doloop ; 2 if PF is set, we have an op byte, so do next iteration

P.S.: nice, superogue!
Needs more POSIX sh

Code:SAVEDPCNT=$(echo "$SAVEDBYTE $ORGSIZE" | awk '{ print ($1/$2)*100 }')
added on the 2020-05-24 22:57:23 by grip grip
Niet met uw auto op het gazon!

Code: 192 ldarg.0 193 call System.Boolean PlayerGTA::InNoDriveVolume() 198 brfalse.s -> (70) call System.Boolean UnityEngine.Cursor::get_visible() 200 ldstr Niet met uw auto op het gazon! 205 stsfld System.String SofaWorldCore.Announcement::announcement
added on the 2020-05-24 23:33:36 by RbR RbR
oooh, MSIL bytecode, long time no see

Code:var lbl = c.DefineLabel(); // can't emit a 'dup' here -- would be better, but might mess up the method's maxstack stuff c.Emit(Brfalse_S, lbl); // 2 bytes c.Emit(Ldloc_3); // 1 byte c.Index++; // callvirt c.Index++; // brtrue.s c.MarkLabel(lbl); // ldc.i4.0


(source, more crimes against bytecodity from a few years ago)
added on the 2020-05-25 02:47:30 by porocyon porocyon
Code:// can't write C without committing some crimes against code standards #define DEFINE_HOOK(rett, name, arglist, ...) \ rett name(__VA_ARGS__) { \ if (pathname != NULL) pathname = fix_path(pathname); \ static void *orig_func = NULL; \ if (orig_func == NULL) orig_func = dlsym(RTLD_NEXT, #name); \ return ((rett (*)(__VA_ARGS__))(orig_func)) arglist; \ }
added on the 2020-06-02 19:54:56 by porocyon porocyon
loopcvx
rept 4
move.w d0,(a0)+
move.w d1,(a0)+
endr
subq #1,d0 ; a multiplier par 4 pour plus tard
;and.w #15,d0
bpl.s loopcvx
moveq #15,d0
addq.w #8,d1
cmp.w #160,d1
bne.s loopcvx
added on the 2020-06-09 07:59:08 by gloky gloky
I can probably remove one of the local variable (by decreasing N instead of using y).
Code://Compute nCk, iterative method computing beginning of Pascal's triangle int nCk_Line1[16+1],nCk_Line2[16+1]; int nCk(int N, int K) { int x,y; if(K>N-K) { K=N-K; } nCk_Line1[0]=1;nCk_Line2[0]=1; for(x=1;x<=K;x++) { nCk_Line1[x]=0; nCk_Line2[x]=0; } for(y=0;y<N;y++) { for(x=1;x<=K;x++) { nCk_Line2[x]=nCk_Line1[x-1]+nCk_Line1[x]; } for(x=1;x<=K;x++) { nCk_Line1[x]=nCk_Line2[x]; } } return(nCk_Line1[K]); }


I agree it's less elegant than this, but sooo much faster and probably way more memory friendly:
Code:int nCk(int N, int K) { if(K>N-K) { K=N-K; } if(N==K) { return(1); } if(K==0) { return(1); } return( nCk(N-1,K)+nCk(N-1,K-1)); }
added on the 2020-06-09 15:51:29 by baah baah
SYS 64738
added on the 2020-06-09 16:43:26 by Phaser Phaser
SYS 2020
added on the 2020-06-10 17:24:25 by Blueberry Blueberry
Code: dc.l (CMD_JSR<<8)|$2d888,crack2-TAB ; disguised $dff00c read
added on the 2020-07-12 22:36:05 by StingRay StingRay
Code: move.l d1,$707C(a5)
added on the 2020-07-13 01:46:42 by ham ham
Code:alias lsd="ls -l | lolcat"
added on the 2020-07-19 21:51:05 by TBit TBit
Code:}
added on the 2020-07-21 02:12:45 by baldrick baldrick
Quote:
_timeAdjust += ((rand() % 1995) / 1995.0) * 0.1;
added on the 2020-08-02 04:53:38 by harism harism
Code:BYTES=$(prep_bytes "$PIC") BYTES=$(echo "ibase=16;obase=2;$BYTES" | bc) for BYTE in $BYTES; do BINS=$(printf "%08d" "$BYTE" | sed "s/\([[:digit:]]\)/ \1/g") ALLBITS="$ALLBITS$BINS" done
added on the 2020-08-02 22:38:48 by grip grip
Code:const bool hasLoopInfo = (fileSize % 9) == 2; if((fileSize % 9) != 0 && !hasLoopInfo) return false;
note to self :: offscreen rendering seems a pain with apple metal api

Quote:
- (void)mtkView:(nonnull MTKView *)view drawableSizeWillChange:(CGSize)size
added on the 2020-08-03 22:09:56 by harism harism
Code:cmp.w #$51c8,d0 ; dbf dx instruction found?
added on the 2020-08-03 22:35:50 by StingRay StingRay
Quote:

* Class StuhlService
added on the 2020-08-03 22:41:09 by pandur pandur
Code:section "Sine tables",rom0,align[8]
added on the 2020-08-03 22:49:08 by DevEd DevEd

login

Go to top