2013-04-05 04:25:47 +00:00
# Getting Started
2013-06-18 07:56:07 +00:00
Compiling **pokecrystal.gbc** requires a certain **Pokemon Crystal** rom:
2013-04-04 20:15:10 +00:00
```
Pokemon - Crystal Version (UE) (V1.0) [C][!].gbc
md5: 9f2922b235a5eeb78d65594e82ef5dde
```
2013-06-18 07:56:07 +00:00
Save it as **baserom.gbc** in the repository.
2013-04-04 20:15:10 +00:00
2013-06-25 23:05:43 +00: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 20:15:10 +00:00
2013-06-18 07:56:07 +00:00
# Windows
2013-04-04 20:15:10 +00:00
2013-06-18 07:56:07 +00:00
If you are on Windows and can't install Linux, **Cygwin** is a great alternative.
2013-04-04 20:15:10 +00:00
2013-06-18 07:56:07 +00: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-07-10 21:58:47 +00:00
* From the package selection, select **wget** .
2013-06-18 07:56:07 +00:00
## Using Cygwin
Launch the **Cygwin terminal** . Maybe you know your way around the Linux terminal, **bash** . If not, a crash course:
```bash
# list files in current directory
ls
# show current directory
pwd
# change directory
cd /away/we/go
```
## Getting up and running
2013-06-25 23:51:04 +00:00
We need a couple more things to be able to compile.
2013-07-10 21:58:47 +00:00
2013-06-25 23:51:04 +00:00
If you're feeling lazy, just paste these commands into your terminal.
2013-06-18 07:56:07 +00:00
2013-07-10 21:58:47 +00:00
**apt-cyg** lets you install new packages without running Cygwin setup.
2013-06-18 07:56:07 +00:00
```bash
2013-07-10 21:58:47 +00:00
wget http://apt-cyg.googlecode.com/svn/trunk/apt-cyg
chmod +x apt-cyg
mv apt-cyg /usr/local/bin/
2013-06-18 07:56:07 +00:00
```
2013-07-10 21:58:47 +00:00
Now we can use apt-cyg to install everything else.
2013-06-18 07:56:07 +00:00
```bash
2013-07-10 21:58:47 +00:00
apt-cyg install make git python python-setuptools unzip
easy_install pip
```
2013-06-25 23:51:04 +00:00
2013-07-10 21:58:47 +00:00
**rgbds** will let you compile Game Boy roms.
2013-06-18 07:56:07 +00:00
2013-07-10 21:58:47 +00:00
```bash
wget http://diyhpl.us/~bryan/irc/pokered/rgbds/rgbds-0.0.1.zip
unzip rgbds-0.0.1.zip
mv rgbds-0.0.1/* /usr/local/bin
rm -r rgbds-0.0.1*
2013-06-18 07:56:07 +00:00
```
Set up the **pokecrystal** repository:
```bash
2013-07-10 21:58:47 +00:00
cd ~
2013-06-18 07:56:07 +00:00
git clone https://github.com/kanzure/pokecrystal
cd pokecrystal
# install python requirements
pip install -r requirements.txt
2013-06-25 23:51:04 +00:00
```
2013-06-18 07:56:07 +00:00
2013-06-25 23:51:04 +00:00
## Don't forget baserom.gbc!!
2013-06-18 07:56:07 +00:00
2013-06-25 23:51:04 +00:00
Make sure you downloaded a base rom. Name it **baserom.gbc** .
2013-06-18 07:56:07 +00:00
Now you should be able to build **pokecrystal.gbc** for the first time.
2013-06-25 23:51:04 +00:00
This compiles a new rom from the source code, with any patches filled in from the base rom.
2013-06-19 01:54:40 +00:00
```bash
make
2013-06-18 07:56:07 +00:00
```
2013-06-25 23:51:04 +00:00
This ought to 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!
2013-06-18 07:56:07 +00:00
2013-06-26 02:03:48 +00:00
Your first compile processes every source file at once. After that, **only modified source files have to be reprocessed** , so compiling again should be a few seconds faster.
2013-06-18 07:56:07 +00:00
2013-06-26 02:03:48 +00:00
Other **make targets** that may come in handy:
2013-06-26 01:19:09 +00:00
2013-06-26 02:03:48 +00:00
`make clean` deletes any preprocessed source files (.tx), rgbds object files and pokecrystal.gbc, in case something goes wrong.
2013-06-26 01:19:09 +00:00
2013-06-26 02:03:48 +00:00
`make pngs` decompresses any **lz** files in gfx/ and then exports any graphics files to **png** .
2013-06-26 01:19:09 +00:00
2013-06-26 02:03:48 +00:00
`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.
2013-06-26 01:19:09 +00:00
2013-06-18 07:56:07 +00:00
# Linux
2012-06-02 20:27:24 +00:00
```bash
sudo apt-get install make gcc bison git python python-setuptools
# unittest2 is required if using python2.6
sudo easy_install unittest2
2013-02-08 02:39:25 +00:00
sudo easy_install pip
2012-06-02 20:27:24 +00:00
# download rgbds source code
git clone git://github.com/bentley/rgbds.git
# compile rgbds
cd rgbds
make
sudo make install
# check if rgbasm is installed now
which rgbasm
# download pokecrystal
2013-02-03 20:54:08 +00:00
git clone git://github.com/kanzure/pokecrystal.git
2012-06-02 20:27:24 +00:00
cd pokecrystal
2013-02-08 02:39:25 +00:00
# install python requirements
pip install -r requirements.txt
2013-06-13 18:23:03 +00:00
# use hexdump to diff binary files
git config diff.hex.textconv hexdump
2013-04-05 04:25:47 +00:00
```
2013-02-08 02:39:25 +00:00
2013-06-18 07:56:07 +00:00
To compile the rom from asm source:
2013-06-19 01:54:40 +00:00
```bash
make
2012-06-02 20:27:24 +00:00
```
2013-06-18 07:56:07 +00: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 20:27:24 +00:00
2013-06-18 07:56:07 +00:00
# Now what?
2012-06-02 20:27:24 +00:00
2013-06-26 02:03:48 +00:00
**main.asm** is a good starting point. The structure of the source is laid out here.
* **Can't find something?** Anyone can add to the source. There's lots to be uncovered.
2012-06-02 20:27:24 +00:00
2013-06-18 07:56:07 +00: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 20:27:24 +00:00
2013-06-25 23:05:43 +00: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 20:27:24 +00:00