Skip to content

Instantly share code, notes, and snippets.

View joel16's full-sized avatar
:octocat:

Joel joel16

:octocat:
  • Wolverhampton, UK
View GitHub Profile
@joel16
joel16 / sceOpenPSIDGetProductCode.c
Last active June 18, 2022 12:18
sceOpenPSIDGetProductCode impl
// Structs and comments taken from uOFW's chkreg pull request #91 https://github.com/uofw/uofw/pull/91
s32 sceIdStorageLookup(u16 key, u32 offset, void *pBuf, u32 len);
/**
* This structure contains console specific information. It is a subset of the ::SceConsoleId.
* Check <openpsid_kernel.h> for possible member values.
*/
typedef struct {
/* Company code. Set to 1. */
@joel16
joel16 / ffmpeg_tutorial05.c
Created July 17, 2018 14:44 — forked from MarcoQin/ffmpeg_tutorial05.c
ffmpeg tutorial 05 with SDL2 and audio resampling fix
// tutorial05.c
// A pedagogical video player that really works!
//
// Code based on FFplay, Copyright (c) 2003 Fabrice Bellard,
// and a tutorial by Martin Bohme ([email protected])
// Tested on Gentoo, CVS version 5/01/07 compiled with GCC 4.1.1
// With updates from https://github.com/chelyaev/ffmpeg-tutorial
// Updates tested on:
// LAVC 54.59.100, LAVF 54.29.104, LSWS 2.1.101, SDL 1.2.15
// on GCC 4.7.2 in Debian February 2015
Result AM_GetStorageId(u64 *storageId, FS_MediaType mediatype, u64 titleId)
{
Result ret = 0;
u32 *cmdbuf = getThreadCommandBuffer();
cmdbuf[0] = IPC_MakeHeader(0x6,3,0); // 0x000600C0
cmdbuf[1] = mediatype;
cmdbuf[2] = titleId & 0xffffffff;
cmdbuf[3] = (u32)(titleId >> 32);
@joel16
joel16 / Multi-screen brightness setter
Created November 21, 2017 20:24
Set each screen's brightness individually using the D-PAD.
#include <3ds.h>
#include <stdio.h>
u32 getBrightness(u32 screen)
{
u32 brightness = 0;
u32 result = 0;
if (R_SUCCEEDED(gspLcdInit()))
{