pouët.net

Random line of code thread

category: code [glöplog]
Code:lda #$80 ldx chrval sta ,x leax 1,x stx chrval ldx chrval2 sta ,x leax -1,x stx chrval2
added on the 2023-03-06 19:34:25 by Enfys Enfys
String string = "Stringers in the Night!"; // Bert Kaempfert
for (;;){fork();}
added on the 2023-03-10 22:04:13 by EviL EviL
Code: MOVE.L DY,d5 MOVE.L DX,d6 SUB.L d6,d5 LSL.L #2,d5 MOVE.L d5,$dff050


Most important lines of code in history of The-Mankind-68k.

BB Image

Doesn't it work? It does!!!! It god damn does!!!!

And it was made by random. I knew there's some shift for pixels along the line, so I started to play with registers and when changed 4dy-2dx to 4dy-4dx, all was gut, all was klaaar!!!!

The most important RANDOM line of code ever!!!!
added on the 2023-04-05 09:35:19 by Laffik Laffik
// simpler version of the sh*t above (FIXME: this bugs, but I like how it looks)
added on the 2023-04-07 11:18:12 by superplek superplek
move.w #284-1,d7 ; damn that's a lot of sprites
added on the 2023-04-07 18:21:56 by freem freem
{(3 << 6) | 63 , {{effect_title_deinit,0}, {voxelEffectStart,0}, {voxelFadeIn,0}, 0, 0}},
added on the 2023-05-05 13:44:38 by noname noname
Code:id my_amp name "my amp" author bsp cat amp param p_level 1 mod m_level <out: * $m_level

a ..simple plugin.
added on the 2023-05-06 12:00:32 by bsp bsp
Code:mov bl,70
OPEN 15,8,15,"UI-":CLOSE 15

// The Commodore 1541 floppy drive uses a slower Commodore 64 compatible mode which can be deactivated for faster speed by using the command. (unfortunately I didn't know this at the time.)
added on the 2023-07-14 11:32:54 by MrVainSCL MrVainSCL
Code:DATA(class_info) = NEW cl_oo_class( clsname = CONV #( cl_abap_typedescr=>describe_by_object_ref( source_instance )->get_relative_name( ) ) ).
added on the 2023-09-08 21:16:53 by StingRay StingRay
Code:-- sick tunes btw currentValue = ffi.string(mod:format_pattern_row_channel_command(pattern, row, channel, command))
added on the 2023-09-10 20:42:36 by lynn lynn
Code:throw new Exception("Oh shit, you should never get here!")
added on the 2023-09-11 09:30:00 by djh0ffman djh0ffman
Code:ld de,-17868
added on the 2023-10-31 06:42:38 by DevEd DevEd
coding hungry

Code:static void drawButter(int[] buffer) {
added on the 2023-11-04 13:50:03 by losso losso
Code:for (int i = 0; i < row.size() - 1; i++) hamwSum += hammingWeight(row[i]);
added on the 2023-11-04 16:32:01 by rudi rudi
Code:jr z, SendBitsFast ; hehe this is definitely gonna fuck some shit up
Code: let displacement = (rng_val - 0.5) * resolution * self.spread_rate;
createContigustable
;
; a0 = ram
; d0 = nombre d'element de la table sinus
; d1 = pas interne
; d2 = nombre de copie de valeurs
; a3 = table de sinus d'amplitude final
;
; pendant le fonctionnement:
; constante d3,d4,d5 = pas interne,*2,*4
;
;
;

; retour:
; a0 = ram
; a1 = adresse table de d0 adresses reftable pris a partir de la ram
;

move.l a0,a1 ; a1 = table refsin
move.l a1,-(sp)
move.w d0,d3
add.w d3,d3 ; *2
move.l a3,a4
add.w d3,a4
add.w d3,d3 ; *4
add.w d3,a0 ; a0 =ram



lea tempbuffer,a2
move.w d0,d4
lsr #2,d4
moveq #0,d3
.clearFlag
move.l d3,(a2)+
dbf d4,.clearFlag ; +- 4 octet

lea tempbuffer,a2
move.l a2,a5
add.w d0,a5



;moveq #0,d5 ; angle

move.w d1,d3 ; pas interne<>0
move.w d3,d4
add d4,d4 ; pas interne*2
move.w d4,d5
add.w d5,d5 ; pas interne*4
neg.w d0
move.w d0,.auto1+2 ; nombre d'elements
move.w d0,.auto1b+2
add.w d0,d0
move.w d0,.auto2+2
move.w d0,.auto2b+2
move.w d0,.auto2c+2
add.w d0,d0
move.w d0,.auto3+2
move.w d0,.auto3b+2
;----------------------------------------
bra.s .loop
.loopaddq
addq.w #2,a3
addq.w #4,a1
; ps le tst.b (a2) deux ligne plus loin est redondant quand on sort de la boucle dans le code flaga1
move.w (a3),d7
bra.s .11
.loop
move.w (a3),d7
tst.b (a2)
bne.s .flaga1
.11 st.b (a2)
move.l a0,(a1) ; on stoque l'adresse de la valeur dans table refsin
move.w d7,(a0)+
; on met a jour a3 avec le pas interne*2
; on met a jour a2 avec le pas interne (flags)
add.w d3,a2
add.w d4,a3
add.w d5,a1

cmp.l a2,a5
bgt.s .loop
.auto1
lea 0(a2),a2
.auto2
lea 0(a3),a3
.auto3
lea 0(a1),a1
bra.s .loop
.flaga1
move.w d2,d6 ; nombre de copie
;subq.w #1,d6

move.l a3,-(sp)
.cpy
move.w d7,(a0)+
add.w d4,a3
cmp.l a3,a4
bgt.s .1
.auto2b
lea 0(a3),a3

.1
move.w (a3),d7
dbf d6,.cpy
move.l (sp)+,a3

addq.w #1,a2
cmp.l a2,a5
bgt.s .2
.auto1b
lea 0(a2),a2
.auto2c
lea 0(a3),a3
.auto3b
lea 0(a1),a1
.2
; s'assurer qu'on est pas en fin de tableau:
;
;

tst.b (a2)
beq.s .loopaddq
.fin
move.l (sp)+,a1

rts
added on the 2023-11-23 07:08:59 by gloky gloky
getmem1:

; d0 = adresse segment 64k non aligné
; d1 = nombre de segment a la suite*64k
; retour: a0 = liste d'adresse
; (a0)+ = 32k buffer
; (a0)+ = 16k buffer
; (a0)+ = 8k buffer
; (a0)+ = 4k buffer
; (a0)+ = 2k
; (a0)+ = 1k
; (a0)+ = 512
; (a0)+ = 256
; (a0)+ = 128
; (a0)+ = 64 octet
;
; a0: 64 octet = 16 adresses

; metre le buffer start dans d4

moveq.w #1,d5
swap d5
move.l d0,d4
sub.l d5,d4 ; start memoire basse
move.l d0,d3
clr.w d3 ; debut multiple de 64k fin memoire basse
; d3 = start segment


move.l d4,d7
sub.l d3,d7 ; d7 = taille en bas
; d4 = start bas

add.l d1,d3 ; d3+ 4*64k = adresse start haut



lea ptrMem,a0
moveq #0,d6
move.w #$8000,d6

.loop
move.w d6,d1
and.w d7,d1

; bit 15 a 0 ?
tst.w d1
beq.s .before ; was beq
move.l d3,(a0)+
add.l d6,d3

bra.s .suite
.before
move.l d4,(a0)+
add.l d6,d4
.suite
lsr #1,d6
tst.w d6
bne.s .loop ; ici ca s'arrete a un buffer de 1 octet il faudrai faire un meilleur test

lea -64(a0),a0 ; et s'arreter a un plus gros buffer
rts

BSS
ptrMem ds.l 16 ; dans ram apres l'appel de getmem1 adresses contenant les bloc memoire utilisable comme on veut
added on the 2023-11-23 07:10:24 by gloky gloky
Code:# AON-style frequency modulation (not phase modulation!) # requires "aon_fm_oscwaves" sample to be loaded arg p_carrier_amp 0.7 0 8 arg p_carrier_amp_env 1 0 1 arg p_carrier_amp_ms 0 1 2000 arg p_carrier_freq 0 -1 1 arg p_carrier_freq_env 0 -1 1 arg p_carrier_freq_ms 0 1 2000 arg p_mod_amp 0 0 32 arg p_mod_amp_env 1 0 1 arg p_mod_amp_ms 0 1 2000 arg p_mod_freq 0 -1 1 arg p_mod_freq_env 0 -1 1 arg p_mod_freq_ms 0 1 2000 arg p_carrier_wave 0 0 11 arg p_mod_wave 0 0 11 arg p_hpf 0 0 1 arg p_hpf_res 0 0 1 curve 0 carrier_freq curve 1 carrier_amp curve 2 mod_freq curve 3 mod_amp # (note) 12 sub-waves (128 frames per cycle) zone 0 aon_fm_oscwaves.all zone 1 aon_fm_oscwaves.all <out: zlp 0 div=12 sub=$p_carrier_wave rate: $p_carrier_freq + rmp $p_carrier_freq_ms 0 0.99 lut carrier_freq * $p_carrier_freq_env bts 16 + zlp 1 div=12 sub=$p_mod_wave rate: $p_mod_freq + rmp $p_mod_freq_ms 0 0.99 lut mod_freq * $p_mod_freq_env bts 16 * rmp $p_mod_amp_ms 0 0.99 lut mod_amp * $p_mod_amp_env * $p_mod_amp * rmp $p_carrier_amp_ms 0 0.99 lut carrier_amp * $p_carrier_amp_env * $p_carrier_amp clp svf mode=1 freq=$p_hpf res=$p_hpf_res clp

well ok, that's more than one line. sounds like this (skip to 2:20 for fast-made demo track): aon style fm test (YT)
added on the 2023-11-24 01:30:07 by bsp bsp
Code:SDL_Delay(60); // 60fps, but why do I even need any fps limit?? this is a musicdisk
added on the 2023-11-30 10:48:44 by Viraxor Viraxor
I'm not sure if above is a troll or not, but congrats on running your musicdisk in ~15 fps ;)
added on the 2023-11-30 11:13:02 by emoon emoon
Quote:
I'm not sure if above is a troll or not, but congrats on running your musicdisk in ~15 fps ;)
:D
added on the 2023-11-30 11:36:39 by ferris ferris
Quote:
Code:DATA(class_info) = NEW cl_oo_class( clsname = CONV #( cl_abap_typedescr=>describe_by_object_ref( source_instance )->get_relative_name( ) ) ).


The really have been a lot of surprises here in all these years, but seeing a ling of ABAP posted on Pouet qualifies as the WTF of the week!
added on the 2023-12-01 00:01:06 by JAC! JAC!

login