Skip to content

Instantly share code, notes, and snippets.

View Themaister's full-sized avatar

Hans-Kristian Arntzen Themaister

View GitHub Profile
#ifndef LIBSNES_HPP
#define LIBSNES_HPP
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
///////////////////////////////////////////////////////////////////////////////
<?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);
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
#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
test.o: file format elf32-i386
Disassembly of section .text:
00000000 <main>:
//clang-fails.c:
#include <stdio.h>
#!/bin/sh
die()
{
echo "Error: $1"
exit 1
}
if [ -z "$1" ]; then
die "Need at least one argument"
.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
// Yep, this is C alright ;)
char** dir_list_new(const char *dir, const char *ext)
{
size_t path_len = strlen(dir);
size_t cur_ptr = 0;
size_t cur_size = 32;
char **dir_list = NULL;
#ifdef _WIN32
#!/usr/bin/env python
def radix(arr):
# Finds max string length to calculate indexes to work on
max_len = 0
for x in arr:
if len(x) > max_len:
max_len = len(x)
<?xml version="1.0" encoding="UTF-8"?>
<!--
4xBR shader
Created by Hyllian.
(License: Unknown)
-->
<shader language="GLSL">
<fragment scale="4.0" filter="nearest"><![CDATA[