Skip to content

Instantly share code, notes, and snippets.

View xerpi's full-sized avatar

Sergi Granell・セルジ xerpi

View GitHub Profile
@xerpi
xerpi / gist:35ad190e2080b3b6d3e7
Created April 24, 2015 15:47
MPCore-PMR-Reader
/*
* MPCore Private Memory Region "reader" by xerpi
* You have to provide a MPCore Private Memory Region dump
*/
#include <stdio.h>
#include <stdint.h>
#define NELEMS(x) (sizeof(x) / sizeof(x[0]))
#define MPCORE_PMR_SIZE (0x2000)
@xerpi
xerpi / buildroot-3ds.patch
Last active February 20, 2016 22:23
buildroot-3ds.patch
diff --git a/package/Config.in b/package/Config.in
index 09c2b40..7660673 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -905,6 +905,7 @@ menu "Graphics"
source "package/powervr/Config.in"
source "package/tiff/Config.in"
source "package/wayland/Config.in"
+ source "package/wayland-protocols/Config.in"
source "package/webkit/Config.in"
#include <stdarg.h>
#include <psp2/net/net.h>
#include <psp2/net/netctl.h>
static int _dbgsock = 0;
static void *net_memory = NULL;
void init_netdbg()
{
@xerpi
xerpi / prof_viewer.c
Last active August 5, 2016 12:41
Vita profiling
#include <cstdio>
#include <cstdint>
#include <cstdlib>
#include <cinttypes>
#include <map>
struct prof_log_entry {
uint64_t start;
uint64_t end;
char func[64];
@xerpi
xerpi / prof_viewer.c
Created August 5, 2016 13:08
Vita static profiling
#include <cstdio>
#include <cstdint>
#include <cstdlib>
#include <cinttypes>
#include <map>
struct prof_log_entry {
uint64_t time;
uint64_t calls;
char name[64];
TARGET = $(notdir $(CURDIR))
OBJS = main.o
CC = xtensa-lx106-elf-gcc
CFLAGS = -I. -mlongcalls
LDLIBS = -nostdlib -Wl,--start-group -lmain -lnet80211 -lwpa -llwip -lpp -lphy -Wl,--end-group -lgcc
LDFLAGS = -Teagle.app.v6.ld
BAUDRATE = 921600
all: $(TARGET)-0x00000.bin
@xerpi
xerpi / Makefile
Created September 20, 2016 15:01
VJ Makefile
TARGET = $(notdir $(CURDIR))
CC = gcc
CXX = g++
CFLAGS = -g -O2 -I/usr/include/SOIL
CXXFLAGS = $(CFLAGS)
LIBS = -lSOIL -lglut -lGLEW -lGL -lm
CFILES = $(wildcard *.c)
CPPFILES = $(wildcard *.cpp)
OBJS = $(CPPFILES:.cpp=.o) $(CFILES:.c=.o)
/*
* wikinidparser by xerpi
* Usage:
* - hxpipe SceFoo > SceFoo_piped
* - ./wikinidparser SceFoo_piped
*/
#include <stdlib.h>
#include <fstream>
#include <sstream>
/*
* vitajsonlinker by xerpi
* - ./vitajsonlinker db1.json [db2.json, ...]
*/
#include <string>
#include <list>
#include <iostream>
#include <jansson.h>
#!/bin/bash
INSTALL_DIR=/opt/vitasdk
sudo rm -rf $INSTALL_DIR
sudo mkdir -p $INSTALL_DIR
sudo chown $USER $INSTALL_DIR
sudo apt-get install -y git cmake geany