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 / .config
Last active September 19, 2021 00:50
Buildroot .config Nintendo 3DS Linux
#
# Automatically generated file; DO NOT EDIT.
# Buildroot 2020.11-312-gfd5eeabac0 Configuration
#
BR2_HAVE_DOT_CONFIG=y
BR2_HOST_GCC_AT_LEAST_4_9=y
BR2_HOST_GCC_AT_LEAST_5=y
BR2_HOST_GCC_AT_LEAST_6=y
BR2_HOST_GCC_AT_LEAST_7=y
BR2_HOST_GCC_AT_LEAST_8=y
@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)
@xerpi
xerpi / make_3ds.sh
Last active April 27, 2023 10:33
Linux 3DS scripts
#!/bin/sh
TOOLCHAIN=/opt/armv6-eabihf--glibc--bleeding-edge-2020.02-2/bin/arm-buildroot-linux-gnueabihf-
cp arch/arm/configs/nintendo3ds_defconfig .config
make ARCH=arm CROSS_COMPILE=$TOOLCHAIN -j8
make ARCH=arm CROSS_COMPILE=$TOOLCHAIN nintendo3ds_ctr.dtb
echo "Output file: ./arch/arm/boot/zImage"
#!/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