This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if __SSE2__ | |
#include <emmintrin.h> | |
// There's no equivalent in libc, you'd think so ... std::mismatch exists, but it's not optimized at all. :( | |
static unsigned find_mismatch(const uint32_t *a, const uint32_t *b, unsigned samples) | |
{ | |
unsigned i; | |
unsigned sse_samples = samples & ~3; | |
for (i = 0; i < sse_samples; i += 4) | |
{ | |
__m128i v0 = _mm_loadu_si128((const __m128i*)(a + i)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Compile: g++ -o dark.so -shared dark.c -std=c99 -O3 -Wall -pedantic -fPIC | |
#include "softfilter.h" | |
#include <stdlib.h> | |
static unsigned impl_input_fmts(void) | |
{ | |
return SOFTFILTER_FMT_XRGB8888; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Compile: gcc -o dark.so -shared dark.c -std=c99 -O3 -Wall -pedantic -fPIC | |
#include "softfilter.h" | |
#include <stdlib.h> | |
static unsigned impl_input_fmts(void) | |
{ | |
return SOFTFILTER_FMT_XRGB8888; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef LIBSNES_HPP | |
#define LIBSNES_HPP | |
#include <stdint.h> | |
#ifdef __cplusplus | |
extern "C" { | |
#endif | |
/////////////////////////////////////////////////////////////////////////////// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<shader language="GLSL"> | |
<vertex><![CDATA[ | |
uniform vec2 rubyTextureSize; | |
void main() { | |
float x = 0.5 * (1.0 / rubyTextureSize.x); | |
float y = 0.5 * (1.0 / rubyTextureSize.y); | |
vec2 dg1 = vec2( x, y); | |
vec2 dg2 = vec2(-x, y); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test.o: file format elf32-i386 | |
Disassembly of section .text: | |
00000000 <main>: | |
//clang-fails.c: | |
#include <stdio.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main (void) { | |
0: 55 push %rbp | |
1: 48 89 e5 mov %rsp,%rbp | |
4: 48 83 ec 20 sub $0x20,%rsp | |
8: 48 b8 c0 bd f0 ff ff movabs $0xfffffffffff0bdc0,%rax | |
f: ff ff ff | |
12: f2 48 0f 2a c0 cvtsi2sd %rax,%xmm0 | |
17: 48 b8 00 b8 17 fe ff movabs $0xfffffffffe17b800,%rax |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0000000000000000 <main>: | |
0: 55 push %rbp | |
1: 48 89 e5 mov %rsp,%rbp | |
4: bf 00 00 00 00 mov $0x0,%edi | |
9: e8 00 00 00 00 callq e <main+0xe> | |
e: bf 00 00 00 00 mov $0x0,%edi | |
13: e8 00 00 00 00 callq 18 <main+0x18> | |
18: bf 00 00 00 00 mov $0x0,%edi | |
1d: e8 00 00 00 00 callq 22 <main+0x22> | |
22: 31 c0 xor %eax,%eax |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
die() | |
{ | |
echo "Error: $1" | |
exit 1 | |
} | |
if [ -z "$1" ]; then | |
die "Need at least one argument" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.include "header.inc" | |
.include "initsnes.asm" | |
.equ BGColorL $0000 | |
.equ BGColorH $0001 | |
; Some handy HW addresses we're using. | |
.equ JoypadState $4212 | |
.equ JoypadStatus $4218 |
OlderNewer