Skip to content

Instantly share code, notes, and snippets.

View TuxSH's full-sized avatar
😼

TuxSH

😼
View GitHub Profile
@TuxSH
TuxSH / fs_dev.c
Last active June 5, 2019 00:29
fs_dev.c for fatfs
#include <errno.h>
#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <fcntl.h>
#include <sys/iosupport.h>
#include <sys/param.h>
#include <unistd.h>
@TuxSH
TuxSH / kernel50.py
Created March 26, 2018 00:16
Kernel 5.0 loader
# Copyright 2017 Reswitched Team
#
# Permission to use, copy, modify, and/or distribute this software for any purpose with or
# without fee is hereby granted, provided that the above copyright notice and this permission
# notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
# SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
# THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
@TuxSH
TuxSH / main.c
Created February 19, 2018 08:35
ifcfg
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <switch.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <net/if.h>
#include <arpa/inet.h>
@TuxSH
TuxSH / ioctls.txt
Last active January 28, 2018 00:04
switch bsdsockets ioctls
_IOC(inout,group,num,len)
r B 102 4 BIOCGBLEN
w B 108 32 BIOCSETIF
w B 112 4 BIOCIMMEDIATE
r B 113 4 BIOCVERSION
r f 118 4 FIONSPACE
r f 119 4 FIONWRITE
@TuxSH
TuxSH / 1de27c5.diff
Last active January 16, 2018 17:23
1de27c5.diff
diff --git a/sysmodules/rosalina/source/menus/cheats.c b/sysmodules/rosalina/source/menus/cheats.c
index 3fbe273..5fb2ae7 100644
--- a/sysmodules/rosalina/source/menus/cheats.c
+++ b/sysmodules/rosalina/source/menus/cheats.c
@@ -70,8 +70,6 @@ static s32 Cheats_FetchProcessInfo(void)
u32 pidList[0x40];
s32 processAmount;
- s64 sa, textTotalRoundedSize, rodataTotalRoundedSize, dataTotalRoundedSize;
-
@TuxSH
TuxSH / notes.txt
Last active August 13, 2017 14:55
M3i Zero-GMPZ003 notes
(word = 32-bit)
-----
Write and read commands
C5 oooooo xx 00 00 => ROM write, FIFO read 0 words write 0x200 words
C9 oooooo xx 00 00 => ROM read, FIFO read 0x200 words write 0 word
oooooo => offset in number of words (?), MSB first
@TuxSH
TuxSH / dma.s1.cdma330.s
Last active August 2, 2017 08:24
dma code found on channel 1
00000000: FLUSHP 0x2
00000002: MOV DAR, #0x00000000
00000008: MOV SAR, #0x10320000
0000000E: MOV DAR, #0x1F219540
00000014: MOV CCR, #0x00BDC2F6
0000001A: LP.0 0x1E
0000001C: WFP 0x2, periph
0000001E: LP.1 0x27
00000020: WMB
00000021: LD
@TuxSH
TuxSH / exheader.h
Last active July 30, 2017 18:17
exheader.h
/// ARM9 descriptor flags
enum
{
ARM9DESC_MOUNT_NAND = BIT(0), ///< Mount "nand:/"
ARM9DESC_MOUNT_NANDRO_RW = BIT(1), ///< Mount nand:/ro/ as read-write
ARM9DESC_MOUNT_TWLN = BIT(2), ///< Mount "twln:/"
ARM9DESC_MOUNT_WNAND = BIT(3), ///< Mount "wnand:/"
ARM9DESC_MOUNT_CARDSPI = BIT(4), ///< Mount "cardspi:/"
ARM9DESC_USE_SDIF3 = BIT(5), ///< Use SDIF3
ARM9DESC_CREATE_SEED = BIT(6), ///< Create seed (movable.sed)
@TuxSH
TuxSH / 3dstypes.h
Last active January 7, 2023 17:34
u32 def
typedef u32 Handle;
typedef s32 Result;
typedef s32 LightLock;
struct RecursiveLock
{
LightLock lock;
u32 threadId;
u32 count;
};
@TuxSH
TuxSH / test_script.txt
Created July 1, 2017 21:30
Pokémon XD test script
.section "FTBL":
.function preprocess, "preprocess"
.function postprocess, "postprocess"
.function modify_floor, "modify_floor"
.function sound, "sound"
.function hero_main, "hero_main"
.function talk_100_hunter_f, "talk_100_hunter_f"
.function talk_101_hunter_f, "talk_101_hunter_f"
.function talk_102_hunter_f, "talk_102_hunter_f"
.function talk_103_hunter_f, "talk_103_hunter_f"