Random line of code thread
category: code [glöplog]
Code:
template <typename Callee, typename F, typename Tuple, size_t... Is>
static auto CallMemb(Callee callee, F f, Tuple& t, std::index_sequence<Is...>) -> decltype((callee->*f)(std::get<Is>(t).ref()...)) {
return (callee->*f)(std::get<Is>(t).ref()...);
}
Code:
move.w #($60<<8)+$35c-$340-2,$340(a5) ; skip cartridge check
Code:
move.w #PATCHLOC+(AckCOP-Patches)-$31a-2,$31a+2(a5)
Code:
if(b_metahost) // Running as a VST plugin in another DAW ?
Code:
shr ah,cl
Code:
move.l #1,$84(a6)
Code:
.found jsr (a2,d2.w) ; call decryption routine
Code:
if DIRTY_DOSLIB_HACK=1
move.l 4.w,a6 ; exec
move.l (a6),a6 ; expans
move.l (a6),a6 ; gfx
move.l (a6),a6 ; layers
move.l (a6),a6 ; intu
move.l (a6),a6 ; mathffp
if KICK_VERSION=13
move.l (a6),a6 ; romboot (1.3 only)
endif
move.l (a6),a6 ; dos
I ought to feel dirty and I do. [insert whining about Amiga's huge executable overhead]
Code:
const char* kRotatorImporterTestData = "2.417"; // Refraction index of... ?
best code is no code (or smaller code)
Code:
;not exiting
;movem.l d2-d7/a4-a6,-(a7)
;lea CHIP_DEST,a3
move.l a3,d6 ; a3 = entry point -4
add.l d6,a3 ; unused chip area in all tested configurations (our hunk is chip)
; d0 and d4 already contain 1.L (args size) when started without arguments
;
;moveq.l #1,d3 ; use d0 instead
;moveq.l #1,d4
ror.l #1,d4
; d3 contains 0000xxxx in all configurations
;
;move.l #NUM_CONTEXTS,d6 ; use d3 instead
move.w #NUM_CONTEXTS,d3
(our hunk is chip) != (our chunk is hip)
Quote:
Code:if DIRTY_DOSLIB_HACK=1 move.l 4.w,a6 ; exec move.l (a6),a6 ; expans move.l (a6),a6 ; gfx move.l (a6),a6 ; layers move.l (a6),a6 ; intu move.l (a6),a6 ; mathffp if KICK_VERSION=13 move.l (a6),a6 ; romboot (1.3 only) endif move.l (a6),a6 ; dos
I ought to feel dirty and I do. [insert whining about Amiga's huge executable overhead]
How about
Code:
lea 4.w,a6
.finddos:
move.l (a6),a6
move.l 10(a6),a0
cmp.w #'do',(a0)
bne.b .finddos
Same size as the smaller version of your code (unless compressed) and not kickstart specific. :)
Quote:
[insert whining about Amiga's huge executable overhead]
*cough* Windows *cough*
Ah yes, forgot the random line of code...
Code:
pextrb [ebp-1], xmm0, 7
@Blueberry: Awesome!! I already kicked out the skip-n-libraries approach, might as well call into ROM directly... Your version still saves me 9 bytes over the proper openlib call (after compression). I'll take it, thanks! :)
Code:
aes_master_key:
incbin "AES_MASTER_KEY.bin"
aes_master_key_end:
Code:
clr.w -(sp)
trap #1
Code:
LTF_343
BGF_605
OWE_320
LMN_506
RLE_599
TOE_503
ONH_912
Code:
g_textures->bindTextureToImage("computetest", 0, GL_WRITE_ONLY);
Code:
; skip fake/crap code
poke(24364,7)
s=0
c=1
cls()
::q::
s+=.5
c+=.15
for a=0,64,.1 do
circ(s+a*cos(s/a),s+a*sin(s/a),1,c)
end
flip()
goto q
s=0
c=1
cls()
::q::
s+=.5
c+=.15
for a=0,64,.1 do
circ(s+a*cos(s/a),s+a*sin(s/a),1,c)
end
flip()
goto q
Code:
#[cfg(windows)] unsafe { timeBeginPeriod(1) };
Code:
public IReadOnlyList<OtaMeasurementPoint> SortPointSequence(IEnumerable<OtaMeasurementPoint> points)
{
return
points.ScanBy(p => p.Allocation.MeasuredAllocation, ChannelAllocationComparer.Instance)
.ThenBy(p => p.Position.Oversampling)
.ThenBy(p => p.Position.Azimuth)
.ThenBy(p => p.Position.Polarization.PolarNumber)
.ThenBy(p => p.Position.Probe.ProbeNumber)
.Scan();
}
Code:
fn rgb(r: u8, g: u8, b: u8) -> u32 {
let r = r as u32;
let g = g as u32;
let b = b as u32;
r << 16 | g << 8 | b
}