2013-04-04 21:25:47 -07:00
# Getting Started
2013-08-12 09:36:27 -07:00
Assembling **pokecrystal.gbc** requires a certain **Pokemon Crystal** rom:
2013-04-04 13:15:10 -07:00
```
Pokemon - Crystal Version (UE) (V1.0) [C][!].gbc
md5: 9f2922b235a5eeb78d65594e82ef5dde
```
2013-06-18 00:56:07 -07:00
Save it as **baserom.gbc** in the repository.
2013-04-04 13:15:10 -07:00
2013-08-12 09:36:27 -07:00
Feel free to ask us on
**[nucleus.kafuka.org #skeetendo ](https://kiwiirc.com/client/irc.nolimitzone.com/?#skeetendo)**
if something goes wrong.
2013-04-04 13:15:10 -07:00
2013-06-18 00:56:07 -07:00
# Windows
2013-04-04 13:15:10 -07:00
2013-08-12 09:36:27 -07:00
If you're on Windows and can't install Linux, **Cygwin** is a great alternative.
2013-04-04 13:15:10 -07:00
2013-06-18 00:56:07 -07:00
## Installing Cygwin
Cygwin provides a virtual Linux environment on Windows systems. Just get **setup.exe** .
**http://cygwin.com/install.html**
During the install:
* Keep the defaults.
* Most mirrors are molasses. Use **http://mirrors.kernel.org** .
2013-08-12 09:36:27 -07:00
* From the package selection, pick:
* **wget**
* **make**
* **git**
* **python**
* **python-setuptools**
* **unzip**
2013-07-10 14:58:47 -07:00
2013-06-18 00:56:07 -07:00
## Using Cygwin
2013-08-12 09:36:27 -07:00
Launch the **Cygwin terminal** .
Maybe you know your way around the Linux terminal ( **bash** ).
If not, a crash course:
2013-06-18 00:56:07 -07:00
```bash
# list files in current directory
ls
# show current directory
pwd
# change directory
cd /away/we/go
```
## Getting up and running
2013-08-12 09:36:27 -07:00
We need three things to assemble the source into a rom.
2013-06-18 00:56:07 -07:00
2013-08-12 09:36:27 -07:00
1. **rgbds**
2. a **pokecrystal** repository
3. a **base rom**
2013-06-25 16:51:04 -07:00
2013-08-12 09:36:27 -07:00
-
2013-06-18 00:56:07 -07:00
2013-08-12 09:36:27 -07:00
We use **rgbds** to spit out a Game Boy rom from source.
2013-07-10 14:58:47 -07:00
```bash
2013-08-12 09:36:27 -07:00
cd /usr/local/bin
wget http://iimarck.us/etc/rgbds-20130811.zip
unzip -j rgbds-20130811.zip
rm rgbds-20130811.zip
2013-06-18 00:56:07 -07:00
```
2013-08-12 09:36:27 -07:00
The **pokecrystal** repository contains the source files used to create the rom.
2013-06-18 00:56:07 -07:00
```bash
2013-07-10 14:58:47 -07:00
cd ~
2013-06-18 00:56:07 -07:00
git clone https://github.com/kanzure/pokecrystal
cd pokecrystal
# install python requirements
2013-08-12 09:36:27 -07:00
easy_install pip
2013-06-18 00:56:07 -07:00
pip install -r requirements.txt
2013-06-25 16:51:04 -07:00
```
2013-06-18 00:56:07 -07:00
2013-08-12 09:36:27 -07:00
Not everything is included in the source yet.
Missing patches are copied from a **base rom** (not included).
```
Pokemon - Crystal Version (UE) (V1.0) [C][!].gbc
md5: 9f2922b235a5eeb78d65594e82ef5dde
```
Name it **baserom.gbc** .
2013-06-18 00:56:07 -07:00
2013-08-12 09:36:27 -07:00
-
2013-06-18 00:56:07 -07:00
Now you should be able to build **pokecrystal.gbc** for the first time.
2013-08-12 09:36:27 -07:00
This assembles a new rom from the source code.
2013-06-18 18:54:40 -07:00
```bash
make
2013-06-18 00:56:07 -07:00
```
2013-06-25 16:51:04 -07:00
This ought to take **between 3 and 15 seconds** , depending on your computer.
2013-08-12 09:36:27 -07:00
If the last line is `cmp baserom.gbc pokecrystal.gbc` , the build was successful!
2013-06-18 00:56:07 -07:00
2013-08-12 09:36:27 -07:00
Your first build processes every source file at once.
After that, **only modified source files have to be processed again** ,
so compiling again should be a few seconds faster.
2013-06-18 00:56:07 -07:00
2013-06-25 18:19:09 -07:00
2013-06-18 00:56:07 -07:00
# Linux
2012-06-02 13:27:24 -07:00
```bash
sudo apt-get install make gcc bison git python python-setuptools
2013-02-07 18:39:25 -08:00
sudo easy_install pip
2012-06-02 13:27:24 -07:00
2013-08-12 09:36:27 -07:00
# install rgbds
2012-06-02 13:27:24 -07:00
git clone git://github.com/bentley/rgbds.git
cd rgbds
make
sudo make install
2013-08-12 09:36:27 -07:00
cd ..
2012-06-02 13:27:24 -07:00
# download pokecrystal
2013-02-03 12:54:08 -08:00
git clone git://github.com/kanzure/pokecrystal.git
2012-06-02 13:27:24 -07:00
cd pokecrystal
2013-02-07 18:39:25 -08:00
pip install -r requirements.txt
2013-04-04 21:25:47 -07:00
```
2013-02-07 18:39:25 -08:00
2013-08-12 09:36:27 -07:00
Put your base rom in the pokecrystal repository. Name it **baserom.gbc** .
To compile the rom from source:
2013-06-18 18:54:40 -07:00
```bash
make
2012-06-02 13:27:24 -07:00
```
2013-08-12 09:36:27 -07:00
That will take between 3 and 15 seconds, depending on your computer.
If you see `cmp baserom.gbc pokecrystal.gbc` as the last line, the build was successful! Rejoice!
2012-06-02 13:27:24 -07:00
2013-06-18 00:56:07 -07:00
# Now what?
2012-06-02 13:27:24 -07:00
2013-08-12 09:36:27 -07:00
**[pokecrystal.asm](https://github.com/kanzure/pokecrystal/blob/master/pokecrystal.asm)** is a good starting point.
The structure of the source is laid out here.
* Other **make targets** that may come in handy:
* `make clean` deletes any preprocessed source files (.tx), rgbds object files and pokecrystal.gbc.
* `make pngs` decompresses any **lz** files in gfx/ and then exports any graphics files to **png** .
* `make lzs` does the reverse. This is already part of the build process, so **modified pngs will automatically be converted to 2bpp and lz-compressed** without any additional work.
* **Can't find something?**
Anyone can add to the source. There's lots to be uncovered.
2013-06-25 19:03:48 -07:00
2013-08-12 09:36:27 -07:00
* **Do your own thing!**
The asm source is hack-friendly, and the supplementary scripts in extras/ can be used for other projects.
2012-06-02 13:27:24 -07:00
2013-08-12 09:36:27 -07:00
We'll be happy to answer any **questions** on
**[nucleus.kafuka.org #skeetendo ](https://kiwiirc.com/client/irc.nolimitzone.com/?#skeetendo)**.
2012-06-02 13:27:24 -07:00