Skip to content

Instantly share code, notes, and snippets.

View xerpi's full-sized avatar

Sergi Granell・セルジ xerpi

View GitHub Profile
@xerpi
xerpi / PSVita_Linux_build_instructions.md
Last active April 1, 2024 12:51
PSVita Linux build instructions
@xerpi
xerpi / 3DS_Linux_build_instructions.md
Last active March 27, 2024 12:02
3DS Linux build instructions

Step 1: Compiling or Downloading the toolchain

Step 1.a: If you choose to download a pre-compiled toolchain (only for Linux x86-64)

  • Go to https://toolchains.bootlin.com
  • Select arch: armv6-eabihf
  • Select libc: glibc
  • Download bleeding-edge
  • Uncompress it (for example to /opt)
  • Add the bin/directory of the toolchain to $PATH
  • In my case: export PATH=$PATH:/opt/armv6-eabihf--glibc--bleeding-edge-2020.08-1
// https://wiki.henkaku.xyz/vita/SDIF_Registers
typedef struct sd_mmc_registers {
uint32_t sdma_system_addr;
uint16_t block_size;
uint16_t block_count;
uint32_t argument1;
uint16_t transfer_mode;
uint16_t command;
uint16_t resp0;
uint16_t resp1;
#include <stdio.h>
#include <string.h>
#include <taihen.h>
#include <psp2kern/kernel/modulemgr.h>
#include <psp2kern/kernel/threadmgr.h>
#include <psp2kern/kernel/sysmem.h>
#include <psp2kern/io/fcntl.h>
#define DUMP_PATH "ux0:dump/"
#define LOG_FILE DUMP_PATH "kplugin_log.txt"
#!/bin/bash
if [ "$#" -lt 1 ]; then
echo -e "Usage:\n\t$0 directory"
exit 1
fi
if [ -z "$VITASDK" ]; then
echo -e "Error: VITASDK is not set."
exit 1
#include "hdmi.h"
#include "libc.h"
#include "utils.h"
#include "adv7511.h"
#include "i2c.h"
#include "gpio.h"
#include "pervasive.h"
#include "syscon.h"
#include "log.h"
@xerpi
xerpi / .config
Last active September 27, 2023 20:32
Buildroot .config PSVita Linux
#
# Automatically generated file; DO NOT EDIT.
# Buildroot 2023.08-458-g05fbb29322 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 / 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"
@xerpi
xerpi / switchpush.sh
Created February 15, 2023 02:53
Switch utils
#!/bin/sh
if [ "$#" -ne 2 ]; then
echo -e "Invalid arguments:\n\tswitchpush src dst"
exit 1
fi
curl -u nxthemer:nxthemer -T "$1" ftp://$SWITCHIP:5000/"$2"
@xerpi
xerpi / camera.dtsi
Last active September 12, 2022 10:08
Ultra96v2 with Raspberry Pi Camera v2.1 (IMX219 sensor)
/ {
cam_clk: cam_clk {
#clock-cells = <0>;
compatible = "fixed-clock";
clock-frequency = <24000000>;
};
};
&i2csw_2 {
imx219@10 {