mirror of
https://github.com/thornAvery/kep-hack.git
synced 2025-09-17 02:40:50 +12:00
Verify that rgbds is at least verson 0.4.0
Adapt the INSTALL guide from pokecrystal.
This commit is contained in:
parent
e4e0af4d67
commit
73be62fad6
184
INSTALL.md
184
INSTALL.md
|
@ -1,60 +1,180 @@
|
||||||
# Linux
|
# Instructions
|
||||||
|
|
||||||
sudo apt-get install make git gcc
|
These instructions explain how to set up the tools required to build **pokered**, including [**rgbds**](https://github.com/rednex/rgbds), which assembles the source files into a ROM.
|
||||||
|
|
||||||
sudo apt-get install byacc flex pkg-config libpng-dev
|
If you run into trouble, ask for help on IRC or Discord (see [README.md](README.md)).
|
||||||
git clone https://github.com/rednex/rgbds
|
|
||||||
cd rgbds
|
|
||||||
sudo make install
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
git clone https://github.com/pret/pokered
|
|
||||||
cd pokered
|
|
||||||
|
|
||||||
To build **pokered.gbc** and **pokeblue.gbc**:
|
|
||||||
|
|
||||||
make
|
|
||||||
|
|
||||||
To build them individually:
|
|
||||||
|
|
||||||
make red
|
|
||||||
make blue
|
|
||||||
|
|
||||||
|
|
||||||
# Mac
|
## Windows 10
|
||||||
|
|
||||||
Get [**Homebrew**](http://brew.sh/).
|
Download and install [**Windows Subsystem for Linux**](https://docs.microsoft.com/en-us/windows/wsl/install-win10). Then open the **WSL terminal**.
|
||||||
|
|
||||||
Then in **Terminal**, run:
|
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 pokered within Windows. You'll have to change the **current working directory** every time you open WSL.
|
||||||
|
|
||||||
xcode-select --install
|
For example, if you want to store pokered in **C:\Users\\*\<user>*\Desktop**, enter this command:
|
||||||
brew install rgbds
|
|
||||||
|
|
||||||
git clone https://github.com/pret/pokered
|
```bash
|
||||||
cd pokered
|
cd /mnt/c/Users/<user>/Desktop
|
||||||
|
```
|
||||||
|
|
||||||
To build **pokered.gbc** and **pokeblue.gbc**:
|
(The Windows `C:\` drive is called `/mnt/c/` in WSL. Replace *\<user>* in the example path with your username.)
|
||||||
|
|
||||||
make
|
Then follow [the instructions for **Linux**](#linux).
|
||||||
|
|
||||||
|
If this doesn't work, try following [the regular Windows instructions](#windows) below.
|
||||||
|
|
||||||
|
|
||||||
# Windows
|
## Windows
|
||||||
|
|
||||||
Download [**Cygwin**](http://cygwin.com/install.html): **setup-x86_64.exe** for 64-bit Windows, **setup-x86.exe** for 32-bit.
|
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:
|
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`
|
- `make`
|
||||||
- `git`
|
- `git`
|
||||||
- `gcc-core`
|
- `gcc-core`
|
||||||
|
|
||||||
Then download [**rgbds**](https://github.com/rednex/rgbds/releases/): the latest **win64.tar.gz** or **win32.tar.gz** release. Extract it and put all the `exe` and `dll` files individually in **C:\cygwin64\usr\local\bin**.
|
Double click on the text that says "**Skip**" next to each package to select the most recent version to install.
|
||||||
|
|
||||||
In the **Cygwin terminal**, enter these commands:
|
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.4.0.** Ignore this if you have never installed rgbds before. If a version newer than 0.4.0 does not work, try downloading 0.4.0.
|
||||||
|
|
||||||
|
Now open the **Cygwin terminal** and enter the following commands.
|
||||||
|
|
||||||
|
Cygwin has its own file system that's within Windows, at **C:\cygwin64\home\\*\<user>***. If you don't want to store pokered there, you'll have to change the **current working directory** every time you open Cygwin.
|
||||||
|
|
||||||
|
For example, if you want to store pokered in **C:\Users\\*\<user>*\Desktop**:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd /cygdrive/c/Users/<user>/Desktop
|
||||||
|
```
|
||||||
|
|
||||||
|
(The Windows `C:\` drive is called `/cygdrive/c/` in Cygwin. Replace *\<user>* in the example path with your username.)
|
||||||
|
|
||||||
|
Now you're ready to [build **pokered**](#build-pokered).
|
||||||
|
|
||||||
|
|
||||||
|
## Mac OS X
|
||||||
|
|
||||||
|
Install [**Homebrew**](https://brew.sh/). Follow the official instructions.
|
||||||
|
|
||||||
|
Open **Terminal** and enter the following commands.
|
||||||
|
|
||||||
|
To install **rgbds**:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
brew install rgbds
|
||||||
|
```
|
||||||
|
|
||||||
|
Now you're ready to [build **pokered**](#build-pokered).
|
||||||
|
|
||||||
|
|
||||||
|
## Linux
|
||||||
|
|
||||||
|
Open **Terminal** and enter the following commands, depending on which distro you're using.
|
||||||
|
|
||||||
|
### Debian or Ubuntu
|
||||||
|
|
||||||
|
To install the software required for **pokered**:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt-get install make gcc git
|
||||||
|
```
|
||||||
|
|
||||||
|
To install **rgbds**:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt-get install pkg-config flex bison libpng-dev
|
||||||
|
git clone -b v0.4.0 --depth=1 https://github.com/rednex/rgbds
|
||||||
|
sudo make -C rgbds install
|
||||||
|
```
|
||||||
|
|
||||||
|
### OpenSUSE
|
||||||
|
|
||||||
|
To install the software required for **pokered**:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo zypper install make gcc git
|
||||||
|
```
|
||||||
|
|
||||||
|
To install **rgbds**:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo zypper install pkg-config flex bison libpng16-devel
|
||||||
|
git clone -b v0.4.0 --depth=1 https://github.com/rednex/rgbds
|
||||||
|
sudo make -C rgbds install
|
||||||
|
```
|
||||||
|
|
||||||
|
### Arch Linux
|
||||||
|
|
||||||
|
To install the software required for **pokered**:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo pacman -S make gcc git
|
||||||
|
```
|
||||||
|
|
||||||
|
**rgbds** is available on the [AUR](https://aur.archlinux.org/packages/rgbds/).
|
||||||
|
|
||||||
|
Alternatively, to install **rgbds** manually:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo pacman -S pkg-config flex bison libpng
|
||||||
|
git clone -b v0.4.0 --depth=1 https://github.com/rednex/rgbds
|
||||||
|
sudo make -C rgbds install
|
||||||
|
```
|
||||||
|
|
||||||
|
### Termux
|
||||||
|
|
||||||
|
To install the software required for **pokered**:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
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 its repositories:
|
||||||
|
|
||||||
|
- `make`
|
||||||
|
- `gcc` (or `clang`)
|
||||||
|
- `git`
|
||||||
|
- `rgbds`
|
||||||
|
|
||||||
|
If `rgbds` is not available, you'll also need these:
|
||||||
|
|
||||||
|
- `pkg-config`
|
||||||
|
- `flex`
|
||||||
|
- `bison`
|
||||||
|
- `libpng` (and the development headers)
|
||||||
|
|
||||||
|
To install **rgbds**:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone -b v0.4.0 --depth=1 https://github.com/rednex/rgbds
|
||||||
|
sudo make -C rgbds install
|
||||||
|
```
|
||||||
|
|
||||||
|
Now you're ready to [build **pokered**](#build-pokered).
|
||||||
|
|
||||||
|
|
||||||
|
## Build pokered
|
||||||
|
|
||||||
|
To download the **pokered** source files:
|
||||||
|
|
||||||
|
```bash
|
||||||
git clone https://github.com/pret/pokered
|
git clone https://github.com/pret/pokered
|
||||||
cd pokered
|
cd pokered
|
||||||
|
```
|
||||||
|
|
||||||
To build **pokered.gbc** and **pokeblue.gbc**:
|
To build **pokered.gbc** and **pokeblue.gbc**:
|
||||||
|
|
||||||
|
```bash
|
||||||
make
|
make
|
||||||
|
```
|
||||||
|
|
17
Makefile
17
Makefile
|
@ -38,19 +38,19 @@ all: $(roms)
|
||||||
red: pokered.gbc
|
red: pokered.gbc
|
||||||
blue: pokeblue.gbc
|
blue: pokeblue.gbc
|
||||||
|
|
||||||
# For contributors to make sure a change didn't affect the contents of the rom.
|
|
||||||
compare: $(roms)
|
|
||||||
@$(MD5) roms.md5
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f $(roms) $(pokered_obj) $(pokeblue_obj) $(roms:.gbc=.map) $(roms:.gbc=.sym)
|
rm -f $(roms) $(pokered_obj) $(pokeblue_obj) $(roms:.gbc=.map) $(roms:.gbc=.sym) rgbdscheck.o
|
||||||
find gfx \( -iname '*.1bpp' -o -iname '*.2bpp' -o -iname '*.pic' \) -delete
|
find gfx \( -iname '*.1bpp' -o -iname '*.2bpp' -o -iname '*.pic' \) -delete
|
||||||
$(MAKE) clean -C tools/
|
$(MAKE) clean -C tools/
|
||||||
|
|
||||||
tidy:
|
tidy:
|
||||||
rm -f $(roms) $(pokered_obj) $(pokeblue_obj) $(roms:.gbc=.map) $(roms:.gbc=.sym)
|
rm -f $(roms) $(pokered_obj) $(pokeblue_obj) $(roms:.gbc=.map) $(roms:.gbc=.sym) rgbdscheck.o
|
||||||
$(MAKE) clean -C tools/
|
$(MAKE) clean -C tools/
|
||||||
|
|
||||||
|
# For contributors to make sure a change didn't affect the original contents of the ROMs.
|
||||||
|
compare: $(roms)
|
||||||
|
@$(MD5) roms.md5
|
||||||
|
|
||||||
tools:
|
tools:
|
||||||
$(MAKE) -C tools/
|
$(MAKE) -C tools/
|
||||||
|
|
||||||
|
@ -64,11 +64,14 @@ endif
|
||||||
$(pokered_obj): RGBASMFLAGS += -D _RED
|
$(pokered_obj): RGBASMFLAGS += -D _RED
|
||||||
$(pokeblue_obj): RGBASMFLAGS += -D _BLUE
|
$(pokeblue_obj): RGBASMFLAGS += -D _BLUE
|
||||||
|
|
||||||
|
rgbdscheck.o: rgbdscheck.asm
|
||||||
|
$(RGBASM) -o $@ $<
|
||||||
|
|
||||||
# The dep rules have to be explicit or else missing files won't be reported.
|
# The dep rules have to be explicit or else missing files won't be reported.
|
||||||
# As a side effect, they're evaluated immediately instead of when the rule is invoked.
|
# As a side effect, they're evaluated immediately instead of when the rule is invoked.
|
||||||
# It doesn't look like $(shell) can be deferred so there might not be a better way.
|
# It doesn't look like $(shell) can be deferred so there might not be a better way.
|
||||||
define DEP
|
define DEP
|
||||||
$1: $2 $$(shell tools/scan_includes $2)
|
$1: $2 $$(shell tools/scan_includes $2) | rgbdscheck.o
|
||||||
$$(RGBASM) $$(RGBASMFLAGS) -o $$@ $$<
|
$$(RGBASM) $$(RGBASMFLAGS) -o $$@ $$<
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
|
12
rgbdscheck.asm
Normal file
12
rgbdscheck.asm
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
; pokered requires rgbds 0.4.0 or newer.
|
||||||
|
MAJOR EQU 0
|
||||||
|
MINOR EQU 4
|
||||||
|
PATCH EQU 0
|
||||||
|
|
||||||
|
if !DEF(__RGBDS_MAJOR__) || !DEF(__RGBDS_MINOR__) || !DEF(__RGBDS_PATCH__)
|
||||||
|
fail "pokered requires rgbds {MAJOR}.{MINOR}.{PATCH} or newer."
|
||||||
|
elif (__RGBDS_MAJOR__ < MAJOR) || \
|
||||||
|
(__RGBDS_MAJOR__ == MAJOR && __RGBDS_MINOR__ < MINOR) || \
|
||||||
|
(__RGBDS_MAJOR__ == MAJOR && __RGBDS_MINOR__ == MINOR && __RGBDS_PATCH__ < PATCH)
|
||||||
|
fail "pokered requires rgbds {MAJOR}.{MINOR}.{PATCH} or newer."
|
||||||
|
endc
|
Loading…
Reference in a new issue