Skip to content

Instantly share code, notes, and snippets.

@GMMan
GMMan / S40rndis
Created January 7, 2021 17:12
RNDIS enabler for Densha de Go! Plug & Play
#!/bin/sh -e
start() {
echo "rndis" > "/sys/class/android_usb/android0/functions"
echo 1 > "/sys/class/android_usb/android0/f_rndis/wceis"
echo 1 > "/sys/class/android_usb/android0/enable"
sleep 1
ifconfig rndis0 169.254.215.100 netmask 255.255.0.0
}
@GMMan
GMMan / GameAndWatchBackdropToGif.cs
Created December 6, 2020 12:15
Game & Watch splash converter
using System;
using System.IO;
namespace GameAndWatchBackdropToGif
{
class Program
{
static void Main(string[] args)
{
if (args.Length != 2)
@GMMan
GMMan / DrawingSongConv.cs
Last active December 5, 2020 04:26
Game & Watch Mario Drawing Song animation converter
using System;
using System.IO;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.Formats.Gif;
using SixLabors.ImageSharp.IO;
using SixLabors.ImageSharp.Memory;
namespace DrawingSongConv
{
class Program
@GMMan
GMMan / decompress_rwdata.cs
Created December 3, 2020 23:40
Game & Watch decompress RWdata snippet
static void DecompressRwData(BinaryReader br, int init_pos, string savePath)
{
br.BaseStream.Seek(init_pos + 4, SeekOrigin.Begin);
int startOffset = init_pos + 4 + br.ReadInt32();
uint length = br.ReadUInt32() >> 1; // lowest bit indicates whether to add base from r9
uint dest = br.ReadUInt32();
br.BaseStream.Seek(startOffset, SeekOrigin.Begin);
File.WriteAllBytes(savePath, DoDecompressRwData(br, length));
}
@GMMan
GMMan / String.lua
Created March 18, 2020 05:10
Crash fix for Angelica Weaver - Catch Me When You Can
---------------------------------------------------------------------------------------------------
--
-- String Utils
--
---------------------------------------------------------------------------------------------------
function ArgToString( arg )
if not arg then
return ''
end
# Copyright (C) 2012 The Android Open Source Project
#
# IMPORTANT: Do not create world writable files or directories.
# This is a common source of Android security bugs.
#
#import /init.${ro.hardware}.rc
import /init.usb.rc
import /init.trace.rc
steam_log_in:
image:
name: "steamcmd:latest"
entrypoint: [""]
script:
- "# Running SteamCMD"
- "cp -r ssfn_cache/. ~/.steam || :"
- echo "${STEAMCMD_STEAMGUARD}" | steamcmd +login "${STEAMCMD_USER}" "${STEAMCMD_PASSWORD}" +quit
- mkdir -p ssfn_cache
- cp -r -t ssfn_cache ~/.steam/ssfn* ~/.steam/config

upgrade_app

upgrade_app is the built-in upgrade flasher on the PlayStation Classic. It reads an upgrade file from USB, verifies it, and flashes it. In normal boot, it needs to be called to start the upgrade process. In recovery boot, it is automatically started and polls for files on an attached USB drive to flash the normal system. The program takes a single argument as a command. They are:

  • normal: Reboots the system to recovery and waits to flash a normal system. It will refuse to boot into recovery if it detects recovery is not successfully
@GMMan
GMMan / instructions.md
Last active April 14, 2019 01:09
OTG flashing instructions

The install isn't too bad as long as you have shell access and can work your way around the command line. Assuming you have BleemSync payload installed:

  1. Download and place the new kernel image on a USB drive.
  2. Plug the PSC to your computer and turn it on.
  3. Plug in the USB drive to the PSC.
  4. Open a telnet connection to the PSC.
  5. Depending on whether you're booting a solution off the USB drive, you may need to mount it. If you don't see anything in /media, do this:
    systemctl stop usb_watch

mount /dev/sda1 /media

@GMMan
GMMan / power_manage.md
Last active April 6, 2023 22:17
PlayStation Classic power management system, documented

PlayStation Classic power management system, documented

This document describes the power management system on the PlayStation Classic. It is mostly focused on the power_manage executable: the command line arguments, control files, and processes. It'll also touch upon the system service setup and startup script.

There are a few components to the power management system: the startup script, the power management service, thermal kernel modules, and supporting programs such as the USB reset script and thermal handling scripts. Let's start with