Skip to content

Instantly share code, notes, and snippets.

@charasyn
charasyn / IntroWithFlags.ccs
Created August 8, 2023 20:17
Earthbound Intro.ccs upgrade to support setting flags before loading the map
//The flyover sequence uses warps 150 and 151 by default
//Warp coordinates can be changed in teleport_destination_table.yml
//Flyover Text
Flyover1:
"[02 0C][01 32]The year is 199X[09][00]"
Flyover2:
"[02 0C][01 0C]Onett, a small town in Eagleland[09][00]"
@charasyn
charasyn / customwin_borderstyles.ccs
Created March 26, 2023 17:37
Earthbound custom window border style patch
// customwin_borderstyles.ccs v1
// Allows custom window border styles
// public domain, but credits are appreciated :)
// cooprocks123e 2022-03-01
import asm65816
import ccexpand
import cc_asmcall
/**********************************************************************
***** Custom Styles ***************************************************
# palettepacker.py
# Cooper Harasyn (cooprocks123e) Sept. 2022
# public domain
# References:
# https://en.wikipedia.org/wiki/Simulated_annealing
# https://www.mathworks.com/help/gads/how-simulated-annealing-works.html
from collections import defaultdict
from functools import reduce, lru_cache
#!/usr/bin/env python3
import heapq
import random
from math import ceil
from typing import List
VERBOSE = True
# generate Catador arrays for compression
class ArrayGenerator:
@charasyn
charasyn / README.md
Created March 18, 2022 17:42
PineNote boot selector Uboot patch

Hello! This gist contains a Python script for extracting and inserting default enviroments from/to a PineNote Uboot image. Hopefully this works but I provide no guarantees. Maybe give it a read-over before running it, don't run code from the internet without knowing what it does, etc...

It also contains a patch for adding a boot "menu" selector based on the contents of a file. It will read mmc0:11:/boot/which_os.txt and based on the first character in that file, boot either Android or Linux. In case of an error, it should fallback to Android. Currently, the details for booting Linux are hard-coded in there to boot from mmc0:11, and it's expecting an extlinux config file in /extlinux/extlinux.conf or /boot/extlinux/extlinux.conf.

Hope this is useful!

@charasyn
charasyn / index.html
Last active February 24, 2022 07:16
EarthBound Window Register Address Calculator
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>EarthBound Window Register Address Calculator</title>
<style>
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
label {
@charasyn
charasyn / instructions.txt
Created December 23, 2021 02:32
Super Mario World Jailbreak - Install on Wii U / SNES Classic / Switch Virtual Console
=================
= Instructions! =
=================
Get powerup state $05
Use slow ACE to write the following ASM into $F0:
F0: A5 E6 (Obj A)
F2: 8D 69 06
F5: E6 F3
@charasyn
charasyn / Block.py
Last active December 19, 2021 14:53
# CoilSnake code :) pls don't hurt me
import array
import copy
import os
from zlib import crc32
InvalidArgumentError = ValueError
OutOfBoundsError = ValueError
def check_range_validity(range, size):
// Condense title screen letters together
// Useful if you are replacing the letters with your own graphics
// cooprocks123e, public domain
// Letter "E"
ROM[0xC422F8] = short -664 // Starting X pos
ROM[0xC422FB] = short 1187 // X velocity
ROM[0xC42301] = short 32 // Ending X pos
// Letter "A"
ROM[0xC42313] = short -504 // Starting X pos
// custom_windows_standalone.ccs - v1
// Allows you to open 2 windows simultaneously with variable sizes
// Doesn't require expand_text_windows (hence the standalone part)
// cooprocks123e 2021
import asm65816
import ccexpand
import cc_asmcall
// Summary: