Skip to content

Instantly share code, notes, and snippets.

huderlem

Block or report user

Report or block huderlem

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View carrot-crazy-compress.go
const (
copyByte = iota
copyBackReference
copyPairs
)
type command struct {
action int
length int
distance int
View carrot-crazy-decompression.go
package main
import (
"bytes"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
)
View Sample .pscr
script BugContestOfficer_EnterContest
{
if (var(VAR_BUG_CONTEST_PRIZE) != ITEM_NONE) {
bufferitemname(0, VAR_BUG_CONTEST_PRIZE)
msgbox(BugContestOfficer_Text_GivePrizeItem)
giveitem_std(VAR_BUG_CONTEST_PRIZE)
if (var(VAR_RESULT)) {
setvar(VAR_BUG_CONTEST_PRIZE, ITEM_NONE)
} else {
msgbox(BugContestOfficer_Text_NoRoomInBag)
View wildencounters2json.py
# pokemap2json.py
# This script will process a pokeemerald project and generate the wild encounters JSON data for it.
# It creates:
# src/data/wild_encounters.json
#
# In order to convert your project's existing data from src/data/wild_encounters.h:
# 1. Merge pret/master.
# 2. Run wildencounters2json.py on your project.
# Example: "python wildencounters2json.py path/to/my/project"
# 3. Commit the src/data/wild_encounters.json file it creates.
View json_fields_num_to_string.py
# This script will convert some map json fields from integers to strings.
# Place this script in data/maps directory, and run it.
# python 3 version of the script
import re
import glob
for filepath in glob.iglob('./**/map.json', recursive=True):
with open(filepath) as file:
View pokemap2json.py
# pokemap2json.py
# This script will process a pokeruby or pokeemerald project and generate the map data JSON files for it.
# It creates:
# data/maps/map_groups.json
# data/layouts/layouts.json
# data/maps/<map_name>/map.json
#
# In order to convert your project to use the new JSON map data, perform the following steps:
# 1. Run pokemap2json.py on your project.
# Example: "python pokemap2json.py emerald path/to/my/project"
@huderlem
huderlem / map-data-conversion.md
Last active Jan 31, 2019
Map Data Conversion
View map-data-conversion.md

This document is a proposal for how the map data for gen 3 decomps could be converted to a data representation that isn't raw assembler and C. The goal of this data conversion would be to make it simpler for external tools to work with the data. Working directly with assembler and C code takes more effort, is more error-prone, and is less extensible. JSON files are used in this document as the chosen data representation because JSON is widely supported and simple enough for a human to read. The chosen format could potentially be something else, but it should be widely supported (i.e. no custom formats). The work for this proposal is split into several parts:

  1. Convert maps data into individual JSON files
  2. Convert layouts data into a single JSON file
  3. Convert map groups into single JSON file
  4. Create new compile-time tool that transforms these JSON files into their old assembler representations (i.e. codegen).

1. Convert maps data into individual JSON files

Each map will move its data into a si

@huderlem
huderlem / style-guide.md
Created Jun 12, 2018
pokeruby/pokeemerald style guide
View style-guide.md

Style Guide - pokeruby/pokeemerald

Version 0.1

Comments

When describing a system/component in-depth, use block comment syntax.

/*
 * This is an in-depth description of the save block format. Its format is as follows:
 *
 * Sectors  0 - 13: Save Slot 1
You can’t perform that action at this time.