Use features new to RGBDS 0.9.2 (#1180)
This commit is contained in:
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
@@ -16,7 +16,7 @@ jobs:
|
|||||||
uses: actions/checkout@master
|
uses: actions/checkout@master
|
||||||
with:
|
with:
|
||||||
path: rgbds
|
path: rgbds
|
||||||
ref: v0.9.0
|
ref: v0.9.2
|
||||||
repository: gbdev/rgbds
|
repository: gbdev/rgbds
|
||||||
|
|
||||||
- name: Install rgbds
|
- name: Install rgbds
|
||||||
|
6
FAQ.md
6
FAQ.md
@@ -41,15 +41,15 @@ You need to install `gcc`. If you're using Cygwin, re-run its setup, and at "Sel
|
|||||||
|
|
||||||
### "ERROR: `UNION` already defined"
|
### "ERROR: `UNION` already defined"
|
||||||
|
|
||||||
Download [**rgbds 0.9.0**][rgbds] or newer. Older versions will not work.
|
Download [**rgbds 0.9.2**][rgbds] or newer. Older versions will not work.
|
||||||
|
|
||||||
### "ERROR: Macro not defined"
|
### "ERROR: Macro not defined"
|
||||||
|
|
||||||
Download [**rgbds 0.9.0**][rgbds] or newer. Older versions will not work.
|
Download [**rgbds 0.9.2**][rgbds] or newer. Older versions will not work.
|
||||||
|
|
||||||
### "Expression must be 8-bit"
|
### "Expression must be 8-bit"
|
||||||
|
|
||||||
Download [**rgbds 0.9.0**][rgbds] or newer. Older versions will not work.
|
Download [**rgbds 0.9.2**][rgbds] or newer. Older versions will not work.
|
||||||
|
|
||||||
### "Segmentation fault" from `rgbgfx`
|
### "Segmentation fault" from `rgbgfx`
|
||||||
|
|
||||||
|
22
INSTALL.md
22
INSTALL.md
@@ -42,9 +42,9 @@ Run setup and leave the default settings. At the "**Select Packages**" step, cho
|
|||||||
|
|
||||||
Double click on the text that says "**Skip**" next to each package to select the most recent version to install.
|
Double click on the text that says "**Skip**" next to each package to select the most recent version to install.
|
||||||
|
|
||||||
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#pre-built) for Windows with Cygwin to install **rgbds 0.9.0**.
|
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#pre-built) for Windows with Cygwin to install **rgbds 0.9.2**.
|
||||||
|
|
||||||
**Note:** If you already have an installed rgbds older than 0.9.0, you will need to update to 0.9.0. Ignore this if you have never installed rgbds before. If a version newer than 0.9.0 does not work, try downloading 0.9.0.
|
**Note:** If you already have an installed rgbds older than 0.9.2, you will need to update to 0.9.2. Ignore this if you have never installed rgbds before. If a version newer than 0.9.2 does not work, try downloading 0.9.2.
|
||||||
|
|
||||||
Now open the **Cygwin terminal** and enter the following commands.
|
Now open the **Cygwin terminal** and enter the following commands.
|
||||||
|
|
||||||
@@ -67,7 +67,7 @@ Install [**Homebrew**](https://brew.sh/). Follow the official instructions.
|
|||||||
|
|
||||||
Open **Terminal** and prepare to enter commands.
|
Open **Terminal** and prepare to enter commands.
|
||||||
|
|
||||||
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#pre-built) for macOS to install **rgbds 0.9.0**.
|
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#pre-built) for macOS to install **rgbds 0.9.2**.
|
||||||
|
|
||||||
Now you're ready to [build **pokecrystal**](#build-pokecrystal).
|
Now you're ready to [build **pokecrystal**](#build-pokecrystal).
|
||||||
|
|
||||||
@@ -84,7 +84,7 @@ To install the software required for **pokecrystal**:
|
|||||||
sudo apt-get install make gcc git
|
sudo apt-get install make gcc git
|
||||||
```
|
```
|
||||||
|
|
||||||
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.9.0** from source.
|
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.9.2** from source.
|
||||||
|
|
||||||
### OpenSUSE
|
### OpenSUSE
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@ To install the software required for **pokecrystal**:
|
|||||||
sudo zypper install make gcc git
|
sudo zypper install make gcc git
|
||||||
```
|
```
|
||||||
|
|
||||||
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.9.0** from source.
|
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.9.2** from source.
|
||||||
|
|
||||||
### Arch Linux
|
### Arch Linux
|
||||||
|
|
||||||
@@ -104,7 +104,7 @@ To install the software required for **pokecrystal**:
|
|||||||
sudo pacman -S make gcc git rgbds
|
sudo pacman -S make gcc git rgbds
|
||||||
```
|
```
|
||||||
|
|
||||||
If you want to compile and install **rgbds** yourself instead, then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.9.0** from source.
|
If you want to compile and install **rgbds** yourself instead, then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.9.2** from source.
|
||||||
|
|
||||||
### Termux
|
### Termux
|
||||||
|
|
||||||
@@ -120,7 +120,7 @@ To install **rgbds**:
|
|||||||
pkg install rgbds
|
pkg install rgbds
|
||||||
```
|
```
|
||||||
|
|
||||||
If you want to compile and install **rgbds** yourself instead, then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.9.0** from source.
|
If you want to compile and install **rgbds** yourself instead, then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.9.2** from source.
|
||||||
|
|
||||||
### Other distros
|
### Other distros
|
||||||
|
|
||||||
@@ -131,7 +131,7 @@ If your distro is not listed here, try to find the required software in its repo
|
|||||||
- `git`
|
- `git`
|
||||||
- `rgbds`
|
- `rgbds`
|
||||||
|
|
||||||
If `rgbds` is not available, you'll need to follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.9.0** from source.
|
If `rgbds` is not available, you'll need to follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.9.2** from source.
|
||||||
|
|
||||||
Now you're ready to [build **pokecrystal**](#build-pokecrystal).
|
Now you're ready to [build **pokecrystal**](#build-pokecrystal).
|
||||||
|
|
||||||
@@ -159,12 +159,12 @@ make crystal11
|
|||||||
|
|
||||||
### Build with a local rgbds version
|
### Build with a local rgbds version
|
||||||
|
|
||||||
If you have different projects that require different versions of `rgbds`, it might not be convenient to install rgbds 0.9.0 globally. Instead, you can put its files in a directory within pokecrystal, such as `pokecrystal/rgbds-0.9.0/`. Then specify it when you run `make`:
|
If you have different projects that require different versions of `rgbds`, it might not be convenient to install rgbds 0.9.2 globally. Instead, you can put its files in a directory within pokecrystal, such as `pokecrystal/rgbds-0.9.2/`. Then specify it when you run `make`:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
make RGBDS=rgbds-0.9.0/
|
make RGBDS=rgbds-0.9.2/
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
make RGBDS=rgbds-0.9.0/ crystal11
|
make RGBDS=rgbds-0.9.2/ crystal11
|
||||||
```
|
```
|
||||||
|
@@ -422,8 +422,8 @@
|
|||||||
pushc
|
pushc
|
||||||
newcharmap unown
|
newcharmap unown
|
||||||
DEF PRINTABLE_UNOWN EQUS "ABCDEFGHIJKLMNOPQRSTUVWXYZ-"
|
DEF PRINTABLE_UNOWN EQUS "ABCDEFGHIJKLMNOPQRSTUVWXYZ-"
|
||||||
for i, STRLEN("{PRINTABLE_UNOWN}")
|
for i, STRLEN(#PRINTABLE_UNOWN)
|
||||||
charmap STRSUB("{PRINTABLE_UNOWN}", i + 1, 1), $10 * (i / 8) + 2 * i
|
charmap STRSLICE(#PRINTABLE_UNOWN, i, i + 1), $10 * (i / 8) + 2 * i
|
||||||
endr
|
endr
|
||||||
charmap "@", $ff ; end
|
charmap "@", $ff ; end
|
||||||
popc
|
popc
|
||||||
@@ -432,8 +432,8 @@ popc
|
|||||||
pushc
|
pushc
|
||||||
newcharmap ascii
|
newcharmap ascii
|
||||||
DEF PRINTABLE_ASCII EQUS " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz\{|}~"
|
DEF PRINTABLE_ASCII EQUS " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz\{|}~"
|
||||||
for i, STRLEN("{PRINTABLE_ASCII}")
|
for i, STRLEN(#PRINTABLE_ASCII)
|
||||||
charmap STRSUB("{PRINTABLE_ASCII}", i + 1, 1), i + $20
|
charmap STRSLICE(#PRINTABLE_ASCII, i, i + 1), i + $20
|
||||||
endr
|
endr
|
||||||
charmap "\t", $09
|
charmap "\t", $09
|
||||||
charmap "\n", $0a
|
charmap "\n", $0a
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
MACRO unownword
|
MACRO unownword
|
||||||
for n, CHARLEN(\1)
|
for n, CHARLEN(\1)
|
||||||
db CHARSUB(\1, n + 1) - "A" + FIRST_UNOWN_CHAR
|
db STRCHAR(\1, n) - "A" + FIRST_UNOWN_CHAR
|
||||||
endr
|
endr
|
||||||
db -1
|
db -1
|
||||||
ENDM
|
ENDM
|
||||||
|
@@ -198,7 +198,7 @@ MACRO dict
|
|||||||
jr nz, .not\@
|
jr nz, .not\@
|
||||||
ld a, \2
|
ld a, \2
|
||||||
.not\@:
|
.not\@:
|
||||||
elif !STRCMP(STRSUB("\2", 1, 1), ".")
|
elif STRFIND("\2", ".") == 0
|
||||||
; Locals can use a short jump
|
; Locals can use a short jump
|
||||||
jr z, \2
|
jr z, \2
|
||||||
else
|
else
|
||||||
|
@@ -38,7 +38,7 @@ MACRO list_start
|
|||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
MACRO li
|
MACRO li
|
||||||
assert !STRIN(\1, "@"), STRCAT("String terminator \"@\" in list entry: ", \1)
|
assert STRFIND(\1, "@") == -1, STRCAT("String terminator \"@\" in list entry: ", \1)
|
||||||
db \1, "@"
|
db \1, "@"
|
||||||
DEF list_index += 1
|
DEF list_index += 1
|
||||||
ENDM
|
ENDM
|
||||||
|
@@ -187,7 +187,7 @@ ENDM
|
|||||||
|
|
||||||
const loadvar_command ; $1e
|
const loadvar_command ; $1e
|
||||||
MACRO loadvar
|
MACRO loadvar
|
||||||
if STRIN("\1", "VAR_") != 1
|
if STRFIND("\1", "VAR_") != 0
|
||||||
; LEGACY: Support for the old name of "loadmem"
|
; LEGACY: Support for the old name of "loadmem"
|
||||||
loadmem \1, \2
|
loadmem \1, \2
|
||||||
else
|
else
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
IF !DEF(__RGBDS_MAJOR__) || !DEF(__RGBDS_MINOR__) || !DEF(__RGBDS_PATCH__)
|
IF !DEF(__RGBDS_MAJOR__) || !DEF(__RGBDS_MINOR__) || !DEF(__RGBDS_PATCH__)
|
||||||
fail "pokecrystal requires rgbds v0.9.0 or newer."
|
fail "pokecrystal requires rgbds v0.9.2 or newer."
|
||||||
ENDC
|
ENDC
|
||||||
IF __RGBDS_MAJOR__ == 0 && __RGBDS_MINOR__ < 9
|
IF __RGBDS_MAJOR__ == 0 && (__RGBDS_MINOR__ < 9 || (__RGBDS_MINOR__ == 9 && __RGBDS_PATCH__ < 2))
|
||||||
fail "pokecrystal requires rgbds v0.9.0 or newer."
|
fail "pokecrystal requires rgbds v0.9.2 or newer."
|
||||||
ENDC
|
ENDC
|
||||||
|
@@ -90,14 +90,14 @@ for objfile in objects:
|
|||||||
elif magic == b'RGB9':
|
elif magic == b'RGB9':
|
||||||
obj_ver = 10 + unpack_from('<I', file)[0]
|
obj_ver = 10 + unpack_from('<I', file)[0]
|
||||||
|
|
||||||
if obj_ver not in [6, 10, 11, 12, 13, 15, 16, 17, 18, 19, 20, 21]:
|
if obj_ver not in [6, 10, 11, 12, 13, 15, 16, 17, 18, 19, 20, 21, 22]:
|
||||||
print(f"Error: File '{objfile}' is of an unknown format.", file=sys.stderr)
|
print(f"Error: File '{objfile}' is of an unknown format.", file=sys.stderr)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
num_symbols = unpack_from('<I', file)[0]
|
num_symbols = unpack_from('<I', file)[0]
|
||||||
unpack_from('<I', file) # skip num sections
|
unpack_from('<I', file) # skip num sections
|
||||||
|
|
||||||
if obj_ver in [16, 17, 18, 19, 20, 21]:
|
if obj_ver in [16, 17, 18, 19, 20, 21, 22]:
|
||||||
node_filenames = []
|
node_filenames = []
|
||||||
num_nodes = unpack_from('<I', file)[0]
|
num_nodes = unpack_from('<I', file)[0]
|
||||||
for x in range(num_nodes):
|
for x in range(num_nodes):
|
||||||
@@ -117,7 +117,7 @@ for objfile in objects:
|
|||||||
sym_type = symtype(unpack_from('<B', file)[0] & 0x7f)
|
sym_type = symtype(unpack_from('<B', file)[0] & 0x7f)
|
||||||
if sym_type == symtype.IMPORT:
|
if sym_type == symtype.IMPORT:
|
||||||
continue
|
continue
|
||||||
if obj_ver in [16, 17, 18, 19, 20, 21]:
|
if obj_ver in [16, 17, 18, 19, 20, 21, 22]:
|
||||||
sym_fileno = unpack_from('<I', file)[0]
|
sym_fileno = unpack_from('<I', file)[0]
|
||||||
sym_filename = node_filenames[sym_fileno]
|
sym_filename = node_filenames[sym_fileno]
|
||||||
else:
|
else:
|
||||||
|
Reference in New Issue
Block a user