Skip to content

Instantly share code, notes, and snippets.

View jaames's full-sized avatar
🐳
~

James jaames

🐳
~
  • UK, '97
  • 23:17 (UTC +01:00)
View GitHub Profile
@jaames
jaames / playdate-curve.lua
Last active May 1, 2024 11:46
Simple bezier curve drawing functions for the Playdate Lua SDK
-- bezier curve drawing functions for playdate lua
-- these are based on de Casteljau's algorithm
-- this site has a nice interactive demo to compare both types of curve: https://pomax.github.io/bezierinfo/#flattening
-- draws a curve starting at x1,y1, ending at x3,y3, with x2,y2 being a control point that "pulls" the curve towards it
-- steps is the number of line segments to use, lower is better for performance, higher makes your curve look smoother
-- the playdate is kinda slow, so it's recommended to find a relatively low step number that looks passable enough!
function drawQuadraticBezier(x1, y1, x2, y2, x3, y3, steps)
steps = steps or 8
local d = 1 / steps
@jaames
jaames / astro.config.mjs
Created January 3, 2022 15:14
Injecting global SCSS variables in Astro (https://astro.build), using additionalData and a path alias
import { fileURLToPath } from 'url';
import path, { dirname } from 'path';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
export default {
// all the usual config goes here...

Requirements

You will need a 3DS running Luma CFW, as well as a computer that is capable of creating an access point or running a proxy.

SSL Module Patch

It is necessary to disable Root CA Verification in order to capture all 3DS traffic. We recommend doing this with SciresM's 3DS-SSL-Patch.

For ease of use, you can download this premade code.ips patch and place it at /luma/titles/0004013000002F02/code.ips on your 3DS' SD card. Make sure that you've enabled Luma's game patching feature by holding down the select button while powering on your 3DS.

@jaames
jaames / mii-qr.py
Created July 24, 2018 21:02
Decrypt Mii QR code data from 3DS / Wii U / Miitomo
# Decrypt Mii QR codes from 3DS / Wii U / Miitomo
# Usage: python3 <input file> <output file>
# QR docs: https://www.3dbrew.org/wiki/Mii_Maker
from Crypto.Cipher import AES
from sys import argv
key = bytes([0x59, 0xFC, 0x81, 0x7E, 0x64, 0x46, 0xEA, 0x61, 0x90, 0x34, 0x7B, 0x20, 0xE9, 0xBD, 0xCE, 0x52])
with open(argv[1], "rb") as infile, open(argv[2], "wb") as outfile:
@jaames
jaames / fonts.md
Last active February 13, 2024 14:53
Cool free/cheap font foundries
@jaames
jaames / miitomo_questions.md
Last active February 8, 2024 18:31
Full set of questions dumped from Miitomo
@jaames
jaames / dsi_shop_kong_api.md
Last active January 5, 2024 14:38
Nintendo DSI Shop reverse-engineering notes

ECommerceInterface

This API provides access to information and features related to ecommerce. Such as providing a list of installed titles, etc

Setup

First it's necessary to create an instance of the ECommerceInterface class, the instance is used to interact with the API.

Nintendo create a single instance and store it globally as ec:

Setup

  1. Enter the Nintendo WFC Settings menu, which can be found in any WFC-enabled game.

  2. Select "Nintendo Wi-Fi Connection Settings".

  3. Set up a new connection if you haven't already done so, then select the connection slot you wish to use.

  4. Scroll down and set "Auto-obtain DNS" to "No", then set Primary DNS to 178.62.43.212 and Secondary DNS to 0.0.0.0. Select "OK" to confirm.

@jaames
jaames / main.c
Last active November 27, 2023 03:29
Playdate C memory management functions (and extras!) as macros
// usage example in your C entry file...
#include "pd_api.h"
#include "platform.h"
PlaydateAPI *pd = NULL;
int eventHandler(PlaydateAPI *playdate, PDSystemEvent event, uint32_t arg)
{
if (event == kEventInitLua) {