Random line of code thread
category: code [glöplog]
Code:
While S!=95
30->G
While G!=33
Pxl-Change(G,S
G+1->G
End
S+1->S
End
@Parzival: you can try the "IS>(" (and "DS>(") commands, those do the inc/dec and jumping for you, but are faster because of less tokenisation overhead. ("For(" might be a little faster as well, but YMMV.)
(Secondly, you can also abuse the function plotter...)
(Secondly, you can also abuse the function plotter...)
Code:
; push random lines
ld e, 12
.lines
ld a, r ; R FOR RANDOM. FUCK YOU
ld h, high sintabofs : rlca : ld l, a
ld l, [hl] : ld a, [hl] : ld a, r : add d
ld d, a : rlca : and 0x3E : push af
call dma_stats
@porocyon: I mainly used that method so as to make the code more readable. I can't really use the function plotter as it's part of a loading bar and i hate having to mess with the plotter to get it to work right.
Long story short: i'm a bad coder with a preference of direct plotting. xD
Long story short: i'm a bad coder with a preference of direct plotting. xD
Code:
*cPos++ = in.coords[c][l][z][i][xy];
a.k.a. "who needs three dimensions when you can have five for just ten times the headache"
Code:
XMLNode* node = cascades.FirstChild()->NextSibling()->NextSibling()->FirstChild()->FirstChild()->NextSibling()->NextSibling();
Code:
PutString(pixel, fonts, string("[") + to_string(mouseCoord.x) + string(",") + to_string(mouseCoord.y) + string("]"), 150, 332, 0x000000, 0xffffff);
Code:
;; font size based on resolution/screenmode. if less than 5, clip it back to 5.
if ($1 == size) {
var %size $calc(%dm.screenH / 27)
return $iif(%size < 5, 5, %size)
}
Code:
static inline const DMC64EncDecOp * fmtGetEncDecOp(const DMC64ImageFormat *fmt, const int index)
{
// Ooh .. look at that beaauuuutiful deref ..
return fmt->encdecOpsRef != NULL ? &(* (fmt->encdecOpsRef))[index] : &fmt->encdecOps[index];
}
Code:
noop $findfile($scriptdir..\gfx\patterns\, *.gif, 0, 0, var %patternList $addtok(%patternList, $gettok($nopath($1-), 1, 46), 32))
Code:
double fsinc = (x != 0.0) ? sin( x*kPi ) * iZero( alpha * sqrt( 1 - x*x*(1.0 / firCenterQuad) ) ) / (izeroAlpha * x * kPi) : 1.0;
Code:
static const uint8 OPLChannelToOperator[] = { 0, 1, 2, 8, 9, 10, 16, 17, 18 };
if(oplCh < 9)
return OPLChannelToOperator[oplCh];
else
return OPLChannelToOperator[oplCh - 9] | 0x100;
lol opl
Code:
;; for whatever reason, when tiling a buffer to another buffer, "transparency" no longer works.
;; this makes no sense. I've tripple checked that the colours are identical to the ones chosen
;; as transparent colours, to no avail. The above is the old method, commented out. Below this
;; is a workaround that physically caused Alpha C to cringe so hard he nearly vomited.
var %patternInverted $dmGetGfx($+(patterns\,%input,_inverted.bmp))
drawsave -b1 @dm.buffer.patternTemp %patternInverted
window -c @dm.buffer.patternTemp
dmTileTexture %buffer %patternInverted
Code:
const uchar baconLayer = 0;
const uchar eggsLayer = 0;
Oh, found a bug by posting this, just realized eggsLayer should be 1 :)
Code:
drawtext -r @dm.buffer.glowballs.text.render $calc(%dm.colour.white / 4) $dmTextCenter(a soft shimmer in the darkness, terminal, 26, 320, 180)
Code:
bool EqualEnough(double a, double b) => Math.Abs(a - b) < epsilon;
Code:
projektbeschreibung_nextPage = GetCompleteProjektbeschreibung_Page2(out projektbeschreibung_nextPage_part2);
Code:
dc.w "R",.togglexrot-.TAB ; toggle x-rotation (scroller), blessed are the blind
I'm getting really sick of seeing this one everywhere in the codebase:
Code:
// Add 0.5 to place on edge of pixel
Code:
; kludge! for some weird reason it can happen that the level 6 vector
; is trashed on exit, this workaround should do...
moveq #($78-$64)/4-1,d7
Code:
float t = vk/float(44095); // antilag
Random line of Thread-Code, just choose one yourself from here:
Code:
int main()
{
std::thread first (foo); // spawn new thread that calls foo()
std::thread second (bar,0); // spawn new thread that calls bar(0)
std::cout << "main, foo and bar now execute concurrently...\n";
// synchronize threads:
first.join(); // pauses until first finishes
second.join(); // pauses until second finishes
std::cout << "foo and bar completed.\n";
return 0;
}
Quote:
this is sooooo wrongCode:float t = vk/float(44095); // antilag