summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2020-04-04 14:42:31 -0400
committerRangi <remy.oukaour+rangi42@gmail.com>2020-04-04 15:15:02 -0400
commit0ee9d7a48baed7e9388e7e377b5eab5b4f795688 (patch)
tree749cbc7e9407feb2253573f5264f7006c03e7d52
parenta325db0f14ca3c48bd9057627f7306b207544700 (diff)
Upgrade to rgbds 0.4.0
- fail for rgbds < 0.4.0 - `rst <Label>` - `ds <count>, <byte>` - `shift <N>` - ASCII "\r" - Sorted .sym file
-rw-r--r--FAQ.md4
-rw-r--r--INSTALL.md10
-rw-r--r--Makefile3
-rw-r--r--constants.asm4
-rw-r--r--engine/games/unown_puzzle.asm3
-rw-r--r--gfx/pokegear/town_map_palette_map.asm3
-rw-r--r--gfx/tileset_palette_maps.asm8
-rw-r--r--home/header.asm11
-rw-r--r--lib/mobile/main.asm20
-rw-r--r--macros/coords.asm3
-rw-r--r--macros/data.asm8
-rw-r--r--macros/gfx.asm4
-rw-r--r--macros/rst.asm4
-rw-r--r--mobile/mobile_45.asm14
-rwxr-xr-xtools/sort_symfile.sh14
15 files changed, 42 insertions, 71 deletions
diff --git a/FAQ.md b/FAQ.md
index f09ca63dd..196c16015 100644
--- a/FAQ.md
+++ b/FAQ.md
@@ -38,11 +38,11 @@ You need to install `gcc`. If you're using Cygwin, re-run its setup, and at "Sel
### "ERROR: `UNION` already defined"
-Download [**rgbds 0.3.9**][rgbds] or newer. Older versions will not work.
+Download [**rgbds 0.4.0**][rgbds] or newer. Older versions will not work.
### "Expression must be 8-bit"
-Download [**rgbds 0.3.9**][rgbds] or newer. Older versions will not work.
+Download [**rgbds 0.4.0**][rgbds] or newer. Older versions will not work.
### "Segmentation fault" from `rgbgfx`
diff --git a/INSTALL.md b/INSTALL.md
index 2035da2ff..d3a10e5db 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -38,7 +38,7 @@ Double click on the text that says "**Skip**" next to each package to select the
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.9.** Ignore this if you have never installed rgbds before. If a version newer than 0.3.9 does not work, try downloading 0.3.9.
+**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.
@@ -86,7 +86,7 @@ To install **rgbds**:
```bash
sudo apt-get install pkg-config flex bison libpng-dev
-git clone -b v0.3.9 --depth=1 https://github.com/rednex/rgbds
+git clone -b v0.4.0 --depth=1 https://github.com/rednex/rgbds
sudo make -C rgbds CFLAGS=-O2 install
```
@@ -102,7 +102,7 @@ To install **rgbds**:
```bash
sudo zypper install pkg-config flex bison libpng16-devel
-git clone -b v0.3.9 --depth=1 https://github.com/rednex/rgbds
+git clone -b v0.4.0 --depth=1 https://github.com/rednex/rgbds
sudo make -C rgbds CFLAGS=-O2 install
```
@@ -120,7 +120,7 @@ Alternatively, to install **rgbds** manually:
```bash
sudo pacman -S pkg-config flex bison libpng
-git clone -b v0.3.9 --depth=1 https://github.com/rednex/rgbds
+git clone -b v0.4.0 --depth=1 https://github.com/rednex/rgbds
sudo make -C rgbds CFLAGS=-O2 install
```
@@ -157,7 +157,7 @@ If `rgbds` is not available, you'll also need these:
To install **rgbds**:
```bash
-git clone -b v0.3.9 --depth=1 https://github.com/rednex/rgbds
+git clone -b v0.4.0 --depth=1 https://github.com/rednex/rgbds
sudo make -C rgbds CFLAGS=-O2 install
```
diff --git a/Makefile b/Makefile
index f76131877..0fd96513f 100644
--- a/Makefile
+++ b/Makefile
@@ -94,17 +94,14 @@ endif
pokecrystal.gbc: $(crystal_obj) pokecrystal.link
$(RGBLINK) -n pokecrystal.sym -m pokecrystal.map -l pokecrystal.link -o $@ $(crystal_obj)
$(RGBFIX) -Cjv -i BYTE -k 01 -l 0x33 -m 0x10 -p 0 -r 3 -t PM_CRYSTAL $@
- tools/sort_symfile.sh pokecrystal.sym
pokecrystal11.gbc: $(crystal11_obj) pokecrystal.link
$(RGBLINK) -n pokecrystal11.sym -m pokecrystal11.map -l pokecrystal.link -o $@ $(crystal11_obj)
$(RGBFIX) -Cjv -i BYTE -k 01 -l 0x33 -m 0x10 -n 1 -p 0 -r 3 -t PM_CRYSTAL $@
- tools/sort_symfile.sh pokecrystal11.sym
pokecrystal-au.gbc: $(crystal_au_obj) pokecrystal.link
$(RGBLINK) -n pokecrystal-au.sym -m pokecrystal-au.map -l pokecrystal.link -o $@ $(crystal_au_obj)
$(RGBFIX) -Cjv -i BYTU -k 01 -l 0x33 -m 0x10 -p 0 -r 3 -t PM_CRYSTAL $@
- tools/sort_symfile.sh pokecrystal-au.sym
# For files that the compressor can't match, there will be a .lz file suffixed with the md5 hash of the correct uncompressed file.
diff --git a/constants.asm b/constants.asm
index 7864ec9d0..467163d8f 100644
--- a/constants.asm
+++ b/constants.asm
@@ -1,3 +1,7 @@
+if __RGBDS_MINOR__ < 4
+ fail "pokecrystal requires rgbds 0.4.0 or newer."
+endc
+
INCLUDE "charmap.asm"
INCLUDE "macros.asm"
diff --git a/engine/games/unown_puzzle.asm b/engine/games/unown_puzzle.asm
index 98100629e..15f0b2153 100644
--- a/engine/games/unown_puzzle.asm
+++ b/engine/games/unown_puzzle.asm
@@ -115,8 +115,7 @@ InitUnownPuzzlePiecePositions:
initpuzcoord: MACRO
rept _NARG / 2
db \1 puzcoord \2
- shift
- shift
+ shift 2
endr
ENDM
initpuzcoord 0,0, 0,1, 0,2, 0,3, 0,4, 0,5
diff --git a/gfx/pokegear/town_map_palette_map.asm b/gfx/pokegear/town_map_palette_map.asm
index 67ca7fbdd..3224ec35b 100644
--- a/gfx/pokegear/town_map_palette_map.asm
+++ b/gfx/pokegear/town_map_palette_map.asm
@@ -9,8 +9,7 @@
townmappals: MACRO
rept _NARG / 2
dn PAL_TOWNMAP_\2, PAL_TOWNMAP_\1
- shift
- shift
+ shift 2
endr
ENDM
diff --git a/gfx/tileset_palette_maps.asm b/gfx/tileset_palette_maps.asm
index df751c311..7f94ecc1f 100644
--- a/gfx/tileset_palette_maps.asm
+++ b/gfx/tileset_palette_maps.asm
@@ -4,8 +4,7 @@ tilepal: MACRO
x = \1 << OAM_TILE_BANK
rept (_NARG - 1) / 2
dn (x | PAL_BG_\3), (x | PAL_BG_\2)
- shift
- shift
+ shift 2
endr
ENDM
@@ -109,7 +108,4 @@ INCLUDE "gfx/tilesets/battle_tower_inside_palette_map.asm"
TilesetBattleTowerOutsidePalMap:
INCLUDE "gfx/tilesets/battle_tower_outside_palette_map.asm"
-; unused
-rept 26
- db $06
-endr
+ ds 26, $06 ; unused
diff --git a/home/header.asm b/home/header.asm
index dccbef4d2..40041e75d 100644
--- a/home/header.asm
+++ b/home/header.asm
@@ -4,10 +4,12 @@ SECTION "rst0", ROM0[$0000]
di
jp Start
-SECTION "rst8", ROM0[$0008] ; rst FarCall
+SECTION "rst8", ROM0[$0008]
+FarCall::
jp FarCall_hl
-SECTION "rst10", ROM0[$0010] ; rst Bankswitch
+SECTION "rst10", ROM0[$0010]
+Bankswitch::
ldh [hROMBank], a
ld [MBC3RomBank], a
ret
@@ -18,7 +20,8 @@ SECTION "rst18", ROM0[$0018]
SECTION "rst20", ROM0[$0020]
rst $38
-SECTION "rst28", ROM0[$0028] ; rst JumpTable
+SECTION "rst28", ROM0[$0028]
+JumpTable::
push de
ld e, a
ld d, 0
@@ -63,4 +66,4 @@ Start::
; The cartridge header data is filled in by rgbfix.
; This makes sure it doesn't get used.
- ds $0150 - $0104
+ ds $0150 - @
diff --git a/lib/mobile/main.asm b/lib/mobile/main.asm
index eee2a67d6..fa0ecfbcd 100644
--- a/lib/mobile/main.asm
+++ b/lib/mobile/main.asm
@@ -4,8 +4,6 @@ INCLUDE "macros/enum.asm"
INCLUDE "constants/hardware_constants.asm"
INCLUDE "constants/mobile_constants.asm"
-charmap "<CR>", $d
-
; Mobile Adapter protocol commands
MOBILE_COMMAND_BEGIN_SESSION EQU $10
MOBILE_COMMAND_END_SESSION EQU $11
@@ -4943,31 +4941,31 @@ Unknown_1120a4:
Unknown_1120b0:
db "RCPT TO:<", 0
Unknown_1120ba:
- db "DATA<CR>\n", 0
+ db "DATA\r\n", 0
Unknown_1120c1:
- db "QUIT<CR>\n", 0
+ db "QUIT\r\n", 0
Unknown_1120c8:
db "USER ", 0
Unknown_1120ce:
db "PASS ", 0
Unknown_1120d4:
- db "STAT<CR>\n", 0
+ db "STAT\r\n", 0
Unknown_1120db:
- db "LIST 00000<CR>\n", 0
+ db "LIST 00000\r\n", 0
Unknown_1120e8:
- db "RETR 00000<CR>\n", 0
+ db "RETR 00000\r\n", 0
Unknown_1120f5:
- db "DELE 00000<CR>\n", 0
+ db "DELE 00000\r\n", 0
Unknown_112102:
- db "TOP 00000 0<CR>\n", 0
+ db "TOP 00000 0\r\n", 0
Unknown_112110:
db "GET ", 0
Unknown_112115:
- db " HTTP/1.0<CR>\n", 0
+ db " HTTP/1.0\r\n", 0
Unknown_112121:
db "User-Agent: CGB-", 0
Unknown_112132:
- db "<CR>\n<CR>\n", 0
+ db "\r\n\r\n", 0
Unknown_112137:
db "POST ", 0
Unknown_11213d:
diff --git a/macros/coords.asm b/macros/coords.asm
index 0fbf96ccd..3ea6e4154 100644
--- a/macros/coords.asm
+++ b/macros/coords.asm
@@ -28,8 +28,7 @@ dwcoord: MACRO
; x, y
rept _NARG / 2
dw (\2) * SCREEN_WIDTH + (\1) + wTilemap
- shift
- shift
+ shift 2
endr
ENDM
diff --git a/macros/data.asm b/macros/data.asm
index 76a5d31de..009683213 100644
--- a/macros/data.asm
+++ b/macros/data.asm
@@ -32,18 +32,14 @@ ENDM
dn: MACRO ; nybbles
rept _NARG / 2
db ((\1) << 4) | (\2)
- shift
- shift
+ shift 2
endr
ENDM
dc: MACRO ; "crumbs"
rept _NARG / 4
db ((\1) << 6) | ((\2) << 4) | ((\3) << 2) | (\4)
- shift
- shift
- shift
- shift
+ shift 4
endr
ENDM
diff --git a/macros/gfx.asm b/macros/gfx.asm
index 2753373e0..24c79e1f1 100644
--- a/macros/gfx.asm
+++ b/macros/gfx.asm
@@ -1,9 +1,7 @@
RGB: MACRO
rept _NARG / 3
dw palred (\1) + palgreen (\2) + palblue (\3)
- shift
- shift
- shift
+ shift 3
endr
ENDM
diff --git a/macros/rst.asm b/macros/rst.asm
index 773a5c60d..c8b80aab2 100644
--- a/macros/rst.asm
+++ b/macros/rst.asm
@@ -1,7 +1,3 @@
-FarCall EQU $08
-Bankswitch EQU $10
-JumpTable EQU $28
-
farcall: MACRO ; bank, address
ld a, BANK(\1)
ld hl, \1
diff --git a/mobile/mobile_45.asm b/mobile/mobile_45.asm
index 25ccb0ff0..15dbeddca 100644
--- a/mobile/mobile_45.asm
+++ b/mobile/mobile_45.asm
@@ -491,17 +491,17 @@ Function1143f3:
jp z, .asm_1144c2
inc e
call z, Function1144c8
- cp $d ; CR
+ cp "\r"
jr nz, .asm_11442b
ld a, [de]
inc e
call z, Function1144c8
- cp $a ; NL
+ cp "\n"
jr nz, .asm_11442b
ld a, [de]
- cp $2e ; .
+ cp "."
jr z, .asm_1144ae
- cp $d ; CR
+ cp "\r"
jr z, .asm_1144b8
.asm_11444a
@@ -557,7 +557,7 @@ Function1143f3:
inc bc
inc e
call z, Function1144c8
- cp $d ; "\r"
+ cp "\r"
jr nz, .asm_114486
ld a, [de]
inc bc
@@ -581,14 +581,14 @@ Function1143f3:
inc e
call z, Function1144c8
ld a, [de]
- cp $d ; CR
+ cp "\r"
jp nz, .asm_11442b
.asm_1144b8
inc e
call z, Function1144c8
ld a, [de]
- cp $a ; NL
+ cp "\n"
jp nz, .asm_11442b
.asm_1144c2
diff --git a/tools/sort_symfile.sh b/tools/sort_symfile.sh
deleted file mode 100755
index a712b97c8..000000000
--- a/tools/sort_symfile.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/sh
-TEMP_FILE=$(mktemp)
-sed \
- -e "s/^..:[0-3]/0_ROM0@&/g" \
- -e "s/^..:[4-7]/1_ROMX@&/g" \
- -e "s/^..:[8-9]/2_VRAM@&/g" \
- -e "s/^..:[A-Ba-b]/3_SRAM@&/g" \
- -e "s/^00:[C-Dc-d]/4_WRAM0@&/g" \
- -e "s/^..:[D-Dd-d]/5_WRAMX@&/g" \
- -e "s/^..:[F-Ff-f]/6_HRAM@&/g" \
- $1 \
-| sort \
-| sed -e "s/^.*@//g" > $TEMP_FILE
-mv $TEMP_FILE $1