Git Product home page Git Product logo

decomp-editor's Introduction

decomp-editor

Collection of tools for the Poke-Emerald decompilation project

This project contains a collection of tools for editing various aspects of the pokeemerald decompilation project.

Event Object Editing

One available tool allows for editing overworld object events, or "sprites". This tool allows for editing all of the various properties of an event object, and allows for uploading new sprite images directly.

Project Format

The format used by this tool differs from the default currently present at pokeemerald/master. When loading a project using the default format, the tool will prompt the user with an attempt to auto-convert the format to one usable by this tool. The conversion will automatically handle a majority of the necessary changes to the project directory, but a few need to be handled manually:

  • In jsonproc.cpp, add the following event callbacks.
env.add_callback("upperSnakeCase", 1, [](Arguments& args) {
	string value = args.at(0)->get<string>();
	if (value.empty())
		return value;

	string output;
	output.push_back(std::toupper(value.front()));
	for (size_t i = 1, e = value.size(); i != e; ++i) {
		if (std::isupper(value[i]) || (!std::islower(value[i]) && std::isalpha(value[i - 1])))
			output.push_back('_');
		output.push_back(std::toupper(value[i]));
	}
	return output;
});

env.add_callback("add", 2, [](Arguments& args) {
	int lhs = args.at(0)->get<int>();
	int rhs = args.at(1)->get<int>();

	return lhs + rhs;
});

env.add_callback("multiply", 2, [](Arguments& args) {
	int lhs = args.at(0)->get<int>();
	int rhs = args.at(1)->get<int>();

	return lhs * rhs;
});

env.add_callback("divide", 2, [](Arguments& args) {
	int lhs = args.at(0)->get<int>();
	int rhs = args.at(1)->get<int>();

	return lhs / rhs;
});

Note: Depending on the original contents of your event objects files, you may need to add additional make dependencies to ensure the files are generated before they get included. This can also generally be solved by running make a few times, if you don't want/know how to update the makefile.

Trainer Editing

One available tool allows for editing trainers. This tool allows for editing all of the various properties of a trainer. This includes the party data, available trainer classes, and the front pictures the trainers use in battle.

Project Format

The format used by this tool differs from the default currently present at pokeemerald/master. When loading a project using the default format, the tool will prompt the user with an attempt to auto-convert the format to one usable by this tool. The conversion will automatically handle a majority of the necessary changes to the project directory, but a few need to be handled manually:

  • In jsonproc.cpp, add the following event callbacks.
env.add_callback("CamelCase", 1, [](Arguments& args) {
	string value = args.at(0)->get<string>();
	if (value.empty())
		return value;

	string output;
	output.push_back(std::toupper(value.front()));
	for (size_t i = 1, e = value.size(); i != e; ++i) {
		if (value[i] == '_') {
			if (i != e - 1)
				output.push_back(std::toupper(value[++i]));
			continue;
		}
		output.push_back(std::tolower(value[i]));
	}
	return output;
});

Debugging crashes or failures

In certain situations the tool may hang or fail to load a project if the format of the necessary project *.c files are different than what the tool expects. This comes with the territory of trying to parse .c textually, but can be difficult to debug. If such a situation arises, the editor keeps a log of events in a decompEditor.log file (generally AppData/Roaming) that can be viewed to see which events, including specific files, are leading to the failure.

decomp-editor's People

Contributors

river707 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.