From cd169aec3cb61408365343f12d371dacb57736c1 Mon Sep 17 00:00:00 2001 From: Rangi Date: Sat, 1 Sep 2018 21:45:00 -0400 Subject: [PATCH 1/4] Revise documentation All the INSTALL.md sections have similar structure --- FAQ.md | 2 +- INSTALL.md | 143 +++++++++++++++++++++++++++++++++++++++-------------- 2 files changed, 108 insertions(+), 37 deletions(-) diff --git a/FAQ.md b/FAQ.md index 83b28bfb3..015a517c4 100644 --- a/FAQ.md +++ b/FAQ.md @@ -52,7 +52,7 @@ Run `make clean` to remove all the old `o` files, then re-run `make`. You've made a mistake while writing some of the code. Re-read the modifications you've made to the file it complains about and try to compare them with other code. -If you're not using the latest version of [**rgbds**](https://github.com/rednex/rgbds/releases), update this as well. Don't forget to `make clean` afterwards. +If you're not using the latest version of [**rgbds**][rgbds], update this as well. Don't forget to `make clean` afterwards. ## How do I edit maps? diff --git a/INSTALL.md b/INSTALL.md index 5d9e6a7ae..9c29c8433 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,59 +1,68 @@ # Instructions -The source files are assembled into a ROM using [**rgbds**](https://github.com/rednex/rgbds). -These instructions explain how to set up the tools required to build. +These instructions explain how to set up the tools required to build **pokecrystal**, including [**rgbds**](https://github.com/rednex/rgbds), which assembles the source files into a ROM. If you run into trouble, ask for help on IRC or Discord (see [README.md](README.md)). ## Windows 10 -Set up/install [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10). +Download and install [**Windows Subsystem for Linux**](https://docs.microsoft.com/en-us/windows/wsl/install-win10). Then open the **WSL terminal**. -WSL has its own file system that's not accessible from Windows, but the Windows file system, *is* accessible from WSL. So you're going to want to install pokecrystal within the Windows file system. +WSL has its own file system that's not accessible from Windows, but Windows files *are* accessible from WSL. So you're going to want to install pokecrystal within Windows. You'll have to change the **current working directory** every time you open WSL. -The Windows `C:\` drive is called `/mnt/c/` in WSL. You will have to change the current working directory to within `/mnt/c/` every time you open WSL. +For example, if you want to store pokecrystal in **C:\Users\\*\*\Desktop**, enter this command: -For example, if you want your pokecrystal in `C:\Users\\Desktop`: - -``` +```bash cd /mnt/c/Users//Desktop ``` -(Replace `` with your username.) +(The Windows `C:\` drive is called `/mnt/c/` in WSL. Replace *\* in the example path with your username.) -You will have to run this command each time you open WSL. +Then follow [the instructions for **Linux**](#linux) to build **pokecrystal**. -Follow [the instructions for Linux](#linux) to complete the installation. - -If this doesn't work, try following the regular Windows installation instructions below. +If this doesn't work, try following [the regular Windows instructions](#windows) below. ## Windows +### 1. Install the required software + Download [**Cygwin**](http://cygwin.com/install.html): **setup-x86_64.exe** for 64-bit Windows, **setup-x86.exe** for 32-bit. -Run setup and leave the default settings. At "Select Packages", choose to install the following, all of which are in the "Devel" category: +Run setup and leave the default settings. At the "**Select Packages**" step, choose to install the following, all of which are in the "**Devel**" category: - `make` - `git` - `gcc-core` -Click once on the text that says "Skip" next to each package to select the most recent version to install. +Click once on the text that says "**Skip**" next to each package to select the most recent version to install. Then download [**rgbds**](https://github.com/rednex/rgbds/releases/): the latest **win64.zip** or **win32.zip** release. Extract it and put all the `exe` and `dll` files individually in **C:\cygwin64\usr\local\bin**. -**Note: If you have an older rgbds, you will need to update to 0.3.7 or newer.** Ignore this if you have never installed rgbds before. +**Note: If you already have an older rgbds, you will need to update to 0.3.7 or newer.** Ignore this if you have never installed rgbds before. -In the **Cygwin terminal**, enter these commands: +### 2. Build pokecrystal + +Open the **Cygwin terminal** and enter the following commands. + +Cygwin has its own file system that's within Windows, at **C:\cygwin64\home\\*\***. If you don't want to store pokecrystal there, you'll have to change the **current working directory** every time you open Cygwin. + +For example, if you want to store pokecrystal in **C:\Users\\*\*\Desktop**: + +```bash +cd /cygdrive/c/Users//Desktop +``` + +(The Windows `C:\` drive is called `/cygdrive/c/` in Cygwin. Replace *\* in the example path with your username.) + +To download **pokecrystal**: ```bash git clone https://github.com/pret/pokecrystal cd pokecrystal ``` -The files will be stored in **C:\cygwin64\home\**. - To build **pokecrystal.gbc**: ```bash @@ -67,18 +76,30 @@ make crystal11 ``` -## Mac +## Mac OS X -In **Terminal**, run: +Open **Terminal** and enter the following commands. + +### 1. Install the required software + +To install the **Xcode Command Line Tools**: ```bash xcode-select --install +``` +To install **rgbds**: + +```bash git clone --depth=1 https://github.com/rednex/rgbds -cd rgbds -sudo make CFLAGS=-O2 install -cd .. +sudo make -C rgbds CFLAGS=-O2 install +``` +### 2. Build pokecrystal + +To download **pokecrystal**: + +```bash git clone https://github.com/pret/pokecrystal cd pokecrystal ``` @@ -89,63 +110,107 @@ To build **pokecrystal.gbc**: make ``` +To build **pokecrystal11.gbc**: + +```bash +make crystal11 +``` + ## Linux -### Install the required software +Open **Terminal** and enter the following commands. -#### Debian/Ubuntu +### 1. Install the required software + +The commands to do this depend on which distro you're using. + +#### Debian or Ubuntu + +To install the software required for **pokecrystal**: ```bash -sudo apt-get install make gcc bison git libpng-dev +sudo apt-get install make gcc git +``` +To install **rgbds**: + +```bash +sudo apt-get install bison libpng-dev git clone --depth=1 https://github.com/rednex/rgbds sudo make -C rgbds CFLAGS=-O2 install ``` #### OpenSUSE -```bash -sudo zypper install make gcc bison git libpng16-devel +To install the software required for **pokecrystal**: +```bash +sudo zypper install make gcc git +``` + +To install **rgbds**: + +```bash +sudo zypper install bison libpng16-devel git clone --depth=1 https://github.com/rednex/rgbds sudo make -C rgbds CFLAGS=-O2 install ``` #### Arch Linux -```bash -sudo pacman -S make gcc bison git libpng +To install the software required for **pokecrystal**: +```bash +sudo pacman -S make gcc git +``` + +To install **rgbds**: + +```bash +sudo pacman -S bison libpng git clone --depth=1 https://github.com/rednex/rgbds sudo make -C rgbds CFLAGS=-O2 install ``` #### Termux +To install the software required for **pokecrystal**: + ```bash -sudo apt install make clang git rgbds sed +sudo apt install make clang git sed +``` + +To install **rgbds**: + +```bash +sudo apt install rgbds ``` #### Other distros -If your distro is not listed here, try to find the required software in the repositories: +If your distro is not listed here, try to find the required software in its repositories: + - `make` - `gcc` (or `clang`) - `git` - `rgbds` -To build `rgbds` from source, if not available for your distro, you need, additionally: +If `rgbds` is not available, you'll also need these: + - `bison` - `libpng` (and the development headers) -And run the following commands: +To install **rgbds**: + ```bash git clone --depth=1 https://github.com/rednex/rgbds sudo make -C rgbds CFLAGS=-O2 install ``` -### Download and build the code +### 2. Build pokecrystal + +To download **pokecrystal**: ```bash git clone https://github.com/pret/pokecrystal @@ -157,3 +222,9 @@ To build **pokecrystal.gbc**: ```bash make ``` + +To build **pokecrystal11.gbc**: + +```bash +make crystal11 +``` From d67ef7efd5c702b339a486b44b874a29b4f8629a Mon Sep 17 00:00:00 2001 From: Rangi Date: Sat, 1 Sep 2018 23:02:24 -0400 Subject: [PATCH 2/4] Clarify about rgbds 0.3.7 compatibility --- FAQ.md | 6 +++--- INSTALL.md | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/FAQ.md b/FAQ.md index 015a517c4..948f373d6 100644 --- a/FAQ.md +++ b/FAQ.md @@ -32,7 +32,7 @@ You need to install `gcc`. If you're using Cygwin, re-run its setup, and at "Sel ### "ERROR: `UNION` already defined" -Download [the latest **rgbds** release][rgbds]. Versions earlier than 0.3.3 will not work. +Download [**rgbds 0.3.7**][rgbds]. Older versions will not work. ### "Segmentation fault" from `rgbgfx` @@ -50,9 +50,9 @@ Run `make clean` to remove all the old `o` files, then re-run `make`. ### "Syntax error" -You've made a mistake while writing some of the code. Re-read the modifications you've made to the file it complains about and try to compare them with other code. +If you have not changed any of the asm, make sure you have the latest version of pokecrystal and the correct version of rgbds (see [INSTALL.md](INSTALL.md)). -If you're not using the latest version of [**rgbds**][rgbds], update this as well. Don't forget to `make clean` afterwards. +If you added or changed any code, you've made a mistake while writing some of it. Re-read the modifications you've made to the file it complains about and try to compare them with other code. ## How do I edit maps? diff --git a/INSTALL.md b/INSTALL.md index 9c29c8433..2f369df09 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -40,7 +40,7 @@ Click once on the text that says "**Skip**" next to each package to select the m Then download [**rgbds**](https://github.com/rednex/rgbds/releases/): the latest **win64.zip** or **win32.zip** release. Extract it and put all the `exe` and `dll` files individually in **C:\cygwin64\usr\local\bin**. -**Note: If you already have an older rgbds, you will need to update to 0.3.7 or newer.** Ignore this if you have never installed rgbds before. +**Note: If you already have an older rgbds, you will need to update to 0.3.7.** Ignore this if you have never installed rgbds before. If a version newer than 0.3.7 does not work, try downloading 0.3.7. ### 2. Build pokecrystal @@ -78,10 +78,10 @@ make crystal11 ## Mac OS X -Open **Terminal** and enter the following commands. - ### 1. Install the required software +Open **Terminal** and enter the following commands. + To install the **Xcode Command Line Tools**: ```bash @@ -119,10 +119,10 @@ make crystal11 ## Linux -Open **Terminal** and enter the following commands. - ### 1. Install the required software +Open **Terminal** and enter the following commands. + The commands to do this depend on which distro you're using. #### Debian or Ubuntu From 140a065b7a7c124c3dd03367c1813614caacff86 Mon Sep 17 00:00:00 2001 From: Rangi Date: Sat, 1 Sep 2018 23:53:39 -0400 Subject: [PATCH 3/4] Don't repeat the pokecrystal instructions --- INSTALL.md | 73 +++++++++++------------------------------------------- 1 file changed, 15 insertions(+), 58 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 2f369df09..798f41406 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -19,15 +19,13 @@ cd /mnt/c/Users//Desktop (The Windows `C:\` drive is called `/mnt/c/` in WSL. Replace *\* in the example path with your username.) -Then follow [the instructions for **Linux**](#linux) to build **pokecrystal**. +Then follow [the instructions for **Linux**](#linux). If this doesn't work, try following [the regular Windows instructions](#windows) below. ## Windows -### 1. Install the required software - Download [**Cygwin**](http://cygwin.com/install.html): **setup-x86_64.exe** for 64-bit Windows, **setup-x86.exe** for 32-bit. Run setup and leave the default settings. At the "**Select Packages**" step, choose to install the following, all of which are in the "**Devel**" category: @@ -42,9 +40,7 @@ Then download [**rgbds**](https://github.com/rednex/rgbds/releases/): the latest **Note: If you already have an older rgbds, you will need to update to 0.3.7.** Ignore this if you have never installed rgbds before. If a version newer than 0.3.7 does not work, try downloading 0.3.7. -### 2. Build pokecrystal - -Open the **Cygwin terminal** and enter the following commands. +Now open the **Cygwin terminal** and enter the following commands. Cygwin has its own file system that's within Windows, at **C:\cygwin64\home\\*\***. If you don't want to store pokecrystal there, you'll have to change the **current working directory** every time you open Cygwin. @@ -56,30 +52,11 @@ cd /cygdrive/c/Users//Desktop (The Windows `C:\` drive is called `/cygdrive/c/` in Cygwin. Replace *\* in the example path with your username.) -To download **pokecrystal**: - -```bash -git clone https://github.com/pret/pokecrystal -cd pokecrystal -``` - -To build **pokecrystal.gbc**: - -```bash -make -``` - -To build **pokecrystal11.gbc**: - -```bash -make crystal11 -``` +Now you're ready to [build **pokecrystal**](#build-pokecrystal). ## Mac OS X -### 1. Install the required software - Open **Terminal** and enter the following commands. To install the **Xcode Command Line Tools**: @@ -95,37 +72,14 @@ git clone --depth=1 https://github.com/rednex/rgbds sudo make -C rgbds CFLAGS=-O2 install ``` -### 2. Build pokecrystal - -To download **pokecrystal**: - -```bash -git clone https://github.com/pret/pokecrystal -cd pokecrystal -``` - -To build **pokecrystal.gbc**: - -```bash -make -``` - -To build **pokecrystal11.gbc**: - -```bash -make crystal11 -``` +Now you're ready to [build **pokecrystal**](#build-pokecrystal). ## Linux -### 1. Install the required software +Open **Terminal** and enter the following commands, depending on which distro you're using. -Open **Terminal** and enter the following commands. - -The commands to do this depend on which distro you're using. - -#### Debian or Ubuntu +### Debian or Ubuntu To install the software required for **pokecrystal**: @@ -141,7 +95,7 @@ git clone --depth=1 https://github.com/rednex/rgbds sudo make -C rgbds CFLAGS=-O2 install ``` -#### OpenSUSE +### OpenSUSE To install the software required for **pokecrystal**: @@ -157,7 +111,7 @@ git clone --depth=1 https://github.com/rednex/rgbds sudo make -C rgbds CFLAGS=-O2 install ``` -#### Arch Linux +### Arch Linux To install the software required for **pokecrystal**: @@ -173,7 +127,7 @@ git clone --depth=1 https://github.com/rednex/rgbds sudo make -C rgbds CFLAGS=-O2 install ``` -#### Termux +### Termux To install the software required for **pokecrystal**: @@ -187,7 +141,7 @@ To install **rgbds**: sudo apt install rgbds ``` -#### Other distros +### Other distros If your distro is not listed here, try to find the required software in its repositories: @@ -208,9 +162,12 @@ git clone --depth=1 https://github.com/rednex/rgbds sudo make -C rgbds CFLAGS=-O2 install ``` -### 2. Build pokecrystal +Now you're ready to [build **pokecrystal**](#build-pokecrystal). -To download **pokecrystal**: + +## Build pokecrystal + +To download the **pokecrystal** source files: ```bash git clone https://github.com/pret/pokecrystal From 741d22907e0c23791c5abf0ffbb5b5d9377418df Mon Sep 17 00:00:00 2001 From: Rangi Date: Sun, 2 Sep 2018 15:54:22 -0400 Subject: [PATCH 4/4] Empty rules are unnecessary (error messages are fine without them) --- Makefile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Makefile b/Makefile index d0109a8e5..6ece5e510 100644 --- a/Makefile +++ b/Makefile @@ -215,9 +215,6 @@ gfx/unknown/unknown_egg.2bpp: rgbgfx += -h ### Catch-all graphics rules -%.bin: ; -%.blk: ; - %.2bpp: %.png $(RGBGFX) $(rgbgfx) -o $@ $< $(if $(tools/gfx),\ @@ -230,5 +227,6 @@ gfx/unknown/unknown_egg.2bpp: rgbgfx += -h %.gbcpal: %.png $(RGBGFX) -p $@ $< + %.dimensions: %.png tools/png_dimensions $< $@