Skip to content

Commit 6a8c9bb

Browse files
Rangi42vulcandth
authored andcommitted
Update to RGBDS 0.7.0 (pret/pokecrystal#1101)
1 parent 4d3e3e4 commit 6a8c9bb

23 files changed

+62
-74
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
uses: actions/checkout@master
1717
with:
1818
path: rgbds
19-
ref: v0.6.1
19+
ref: v0.7.0
2020
repository: gbdev/rgbds
2121

2222
- name: Install rgbds

FAQ.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ You need to install `gcc`. If you're using Cygwin, re-run its setup, and at "Sel
4141

4242
### "ERROR: `UNION` already defined"
4343

44-
Download [**rgbds 0.6.0**][rgbds] or newer. Older versions will not work.
44+
Download [**rgbds 0.7.0**][rgbds] or newer. Older versions will not work.
4545

4646
### "ERROR: Macro not defined"
4747

48-
Download [**rgbds 0.6.0**][rgbds] or newer. Older versions will not work.
48+
Download [**rgbds 0.7.0**][rgbds] or newer. Older versions will not work.
4949

5050
### "Expression must be 8-bit"
5151

52-
Download [**rgbds 0.6.0**][rgbds] or newer. Older versions will not work.
52+
Download [**rgbds 0.7.0**][rgbds] or newer. Older versions will not work.
5353

5454
### "Segmentation fault" from `rgbgfx`
5555

INSTALL.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ Run setup and leave the default settings. At the "**Select Packages**" step, cho
4242

4343
Double click on the text that says "**Skip**" next to each package to select the most recent version to install.
4444

45-
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#pre-built) for Windows with Cygwin to install **rgbds 0.6.1**.
45+
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#pre-built) for Windows with Cygwin to install **rgbds 0.7.0**.
4646

47-
**Note:** If you already have an installed rgbds older than 0.6.0, you will need to update to 0.6.0 or 0.6.1. Ignore this if you have never installed rgbds before. If a version newer than 0.6.1 does not work, try downloading 0.6.1.
47+
**Note:** If you already have an installed rgbds older than 0.7.0, you will need to update to 0.7.0. Ignore this if you have never installed rgbds before. If a version newer than 0.7.0 does not work, try downloading 0.7.0.
4848

4949
Now open the **Cygwin terminal** and enter the following commands.
5050

@@ -67,7 +67,7 @@ Install [**Homebrew**](https://brew.sh/). Follow the official instructions.
6767

6868
Open **Terminal** and prepare to enter commands.
6969

70-
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#pre-built) for macOS to install **rgbds 0.6.1**.
70+
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#pre-built) for macOS to install **rgbds 0.7.0**.
7171

7272
Now you're ready to [build **pokecrystal**](#build-pokecrystal).
7373

@@ -84,7 +84,7 @@ To install the software required for **pokecrystal**:
8484
sudo apt-get install make gcc git
8585
```
8686

87-
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.6.1** from source.
87+
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.7.0** from source.
8888

8989
### OpenSUSE
9090

@@ -94,7 +94,7 @@ To install the software required for **pokecrystal**:
9494
sudo zypper install make gcc git
9595
```
9696

97-
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.6.1** from source.
97+
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.7.0** from source.
9898

9999
### Arch Linux
100100

@@ -104,9 +104,7 @@ To install the software required for **pokecrystal**:
104104
sudo pacman -S make gcc git rgbds
105105
```
106106

107-
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#pre-built) for Arch Linux to install **rgbds 0.6.1**.
108-
109-
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.6.1** from source.
107+
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.7.0** from source.
110108

111109
### Termux
112110

@@ -122,7 +120,7 @@ To install **rgbds**:
122120
sudo apt install rgbds
123121
```
124122

125-
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.6.1** from source.
123+
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.7.0** from source.
126124

127125
### Other distros
128126

@@ -133,7 +131,7 @@ If your distro is not listed here, try to find the required software in its repo
133131
- `git`
134132
- `rgbds`
135133

136-
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.6.1** from source.
134+
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.7.0** from source.
137135

138136
Now you're ready to [build **pokecrystal**](#build-pokecrystal).
139137

@@ -161,12 +159,12 @@ make crystal11
161159

162160
### Build with a local rgbds version
163161

164-
If you have different projects that require different versions of `rgbds`, it might not be convenient to install rgbds 0.6.1 globally. Instead, you can put its files in a directory within pokecrystal, such as `pokecrystal/rgbds-0.6.1/`. Then specify it when you run `make`:
162+
If you have different projects that require different versions of `rgbds`, it might not be convenient to install rgbds 0.7.0 globally. Instead, you can put its files in a directory within pokecrystal, such as `pokecrystal/rgbds-0.7.0/`. Then specify it when you run `make`:
165163

166164
```bash
167-
make RGBDS=rgbds-0.6.1/
165+
make RGBDS=rgbds-0.7.0/
168166
```
169167

170168
```bash
171-
make RGBDS=rgbds-0.6.1/ crystal11
169+
make RGBDS=rgbds-0.7.0/ crystal11
172170
```

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ tools:
9393
$(MAKE) -C tools/
9494

9595

96-
RGBASMFLAGS = -hL -Q8 -P includes.asm -Weverything -Wnumeric-string=2 -Wtruncation=1
96+
RGBASMFLAGS = -Q8 -P includes.asm -Weverything -Wnumeric-string=2 -Wtruncation=1
9797
# Create a sym/map for debug purposes if `make` run with `DEBUG=1`
9898
ifeq ($(DEBUG),1)
9999
RGBASMFLAGS += -E

constants/hardware_constants.asm

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,6 @@
33
; https://github.com/gbdev/hardware.inc
44
; http://gameboy.mongenel.com/dmg/asmmemmap.html
55

6-
; memory map
7-
DEF VRAM_Begin EQU $8000
8-
DEF VRAM_End EQU $a000
9-
DEF SRAM_Begin EQU $a000
10-
DEF SRAM_End EQU $c000
11-
DEF WRAM0_Begin EQU $c000
12-
DEF WRAM0_End EQU $d000
13-
DEF WRAM1_Begin EQU $d000
14-
DEF WRAM1_End EQU $e000
15-
; hardware registers $ff00-$ff80 (see below)
16-
DEF HRAM_Begin EQU $ff80
17-
DEF HRAM_End EQU $ffff
18-
196
; MBC3
207
DEF MBC3SRamEnable EQU $0000
218
DEF MBC3RomBank EQU $2000

data/maps/blocks.asm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -996,3 +996,4 @@ SafariRestHouseArea4_Blocks:
996996

997997
SafariZoneEntrance_Blocks:
998998
INCBIN "maps/SafariZoneEntrance.blk"
999+
ENDSECTION

data/maps/scripts.asm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,4 +519,6 @@ INCLUDE "maps/SafariRestHouseArea1.asm"
519519
INCLUDE "maps/SafariRestHouseArea2.asm"
520520
INCLUDE "maps/SafariRestHouseArea3.asm"
521521
INCLUDE "maps/SafariRestHouseArea4.asm"
522-
INCLUDE "maps/Route39.asm"
522+
INCLUDE "maps/Route39.asm"
523+
524+
ENDSECTION

engine/debug/color_picker.asm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,15 @@ endr
129129
DebugColor_InitVRAM:
130130
ld a, $1
131131
ldh [rVBK], a
132-
ld hl, VRAM_Begin
133-
ld bc, VRAM_End - VRAM_Begin
132+
ld hl, STARTOF(VRAM)
133+
ld bc, SIZEOF(VRAM)
134134
xor a
135135
call ByteFill
136136

137137
ld a, $0
138138
ldh [rVBK], a
139-
ld hl, VRAM_Begin
140-
ld bc, VRAM_End - VRAM_Begin
139+
ld hl, STARTOF(VRAM)
140+
ld bc, SIZEOF(VRAM)
141141
xor a
142142
call ByteFill
143143

engine/gfx/color.asm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,8 +1029,8 @@ PushSGBBorder:
10291029
ret
10301030

10311031
SGB_ClearVRAM:
1032-
ld hl, VRAM_Begin
1033-
ld bc, VRAM_End - VRAM_Begin
1032+
ld hl, STARTOF(VRAM)
1033+
ld bc, SIZEOF(VRAM)
10341034
xor a
10351035
call ByteFill
10361036
ret

engine/gfx/load_push_oam.asm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
WriteOAMDMACodeToHRAM::
22
ld c, LOW(hTransferShadowOAM)
3-
ld b, OAMDMACodeEnd - OAMDMACode
3+
ld b, OAMDMACode.End - OAMDMACode
44
ld hl, OAMDMACode
55
.copy
66
ld a, [hli]
@@ -25,4 +25,4 @@ hTransferShadowOAM::
2525
jr nz, .wait
2626
ret
2727
ENDL
28-
OAMDMACodeEnd:
28+
.End:

engine/menus/empty_sram.asm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ endr
77

88
.EmptyBank:
99
call OpenSRAM
10-
ld hl, SRAM_Begin
11-
ld bc, SRAM_End - SRAM_Begin
10+
ld hl, STARTOF(SRAM)
11+
ld bc, SIZEOF(SRAM)
1212
xor a
1313
call ByteFill
1414
call CloseSRAM

engine/menus/intro_menu.asm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ _ResetWRAM:
106106
xor a
107107
call ByteFill
108108

109-
ld hl, WRAM1_Begin
110-
ld bc, wGameData - WRAM1_Begin
109+
ld hl, STARTOF(WRAMX)
110+
ld bc, wGameData - STARTOF(WRAMX)
111111
xor a
112112
call ByteFill
113113

engine/movie/trade_animation.asm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,16 +167,16 @@ RunTradeAnimScript:
167167
jr z, .NotCGB
168168
ld a, $1
169169
ldh [rVBK], a
170-
ld hl, vTiles0
171-
ld bc, VRAM_End - VRAM_Begin
170+
ld hl, STARTOF(VRAM)
171+
ld bc, SIZEOF(VRAM)
172172
xor a
173173
call ByteFill
174174
ld a, $0
175175
ldh [rVBK], a
176176

177177
.NotCGB:
178178
hlbgcoord 0, 0
179-
ld bc, VRAM_End - vBGMap0
179+
ld bc, STARTOF(VRAM) + SIZEOF(VRAM) - vBGMap0
180180
ld a, " "
181181
call ByteFill
182182
ld hl, TradeGameBoyLZ
@@ -490,7 +490,7 @@ TradeAnim_TubeToPlayer8:
490490
call DisableLCD
491491
callfar ClearSpriteAnims
492492
hlbgcoord 0, 0
493-
ld bc, VRAM_End - vBGMap0
493+
ld bc, STARTOF(VRAM) + SIZEOF(VRAM) - vBGMap0
494494
ld a, " "
495495
call ByteFill
496496
xor a

engine/overworld/init_map.asm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ HDMATransfer_FillBGMap0WithBlack:
9393
ldh [rHDMA1], a
9494
ld a, LOW(wDecompressScratch)
9595
ldh [rHDMA2], a
96-
ld a, HIGH(vBGMap0 - VRAM_Begin)
96+
ld a, HIGH(vBGMap0 - STARTOF(VRAM))
9797
ldh [rHDMA3], a
98-
ld a, LOW(vBGMap0 - VRAM_Begin)
98+
ld a, LOW(vBGMap0 - STARTOF(VRAM))
9999
ldh [rHDMA4], a
100100
ld a, $3f
101101
ldh [hDMATransfer], a

home/header.asm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,5 @@ Start::
8383
; This makes sure it doesn't get used for anything else.
8484

8585
ds $0150 - @, $00
86+
87+
ENDSECTION

home/init.asm

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ Init::
6464
ldh [rLCDC], a
6565

6666
; Clear WRAM bank 0
67-
ld hl, WRAM0_Begin
68-
ld bc, WRAM0_End - WRAM0_Begin
67+
ld hl, STARTOF(WRAM0)
68+
ld bc, SIZEOF(WRAM0)
6969
.ByteFill:
7070
ld [hl], 0
7171
inc hl
@@ -82,8 +82,8 @@ Init::
8282
ldh a, [hSystemBooted]
8383
push af
8484
xor a
85-
ld hl, HRAM_Begin
86-
ld bc, HRAM_End - HRAM_Begin
85+
ld hl, STARTOF(HRAM)
86+
ld bc, SIZEOF(HRAM)
8787
call ByteFill
8888
pop af
8989
ldh [hSystemBooted], a
@@ -185,8 +185,8 @@ ClearVRAM::
185185
xor a ; 0
186186
ldh [rVBK], a
187187
.clear
188-
ld hl, VRAM_Begin
189-
ld bc, VRAM_End - VRAM_Begin
188+
ld hl, STARTOF(VRAM)
189+
ld bc, SIZEOF(VRAM)
190190
xor a
191191
call ByteFill
192192
ret
@@ -200,8 +200,8 @@ ClearWRAM::
200200
push af
201201
ldh [rSVBK], a
202202
xor a
203-
ld hl, WRAM1_Begin
204-
ld bc, WRAM1_End - WRAM1_Begin
203+
ld hl, STARTOF(WRAMX)
204+
ld bc, SIZEOF(WRAMX)
205205
call ByteFill
206206
pop af
207207
inc a

home/palettes.asm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,8 @@ ClearVBank1::
293293
ld a, 1
294294
ldh [rVBK], a
295295

296-
ld hl, VRAM_Begin
297-
ld bc, VRAM_End - VRAM_Begin
296+
ld hl, STARTOF(VRAM)
297+
ld bc, SIZEOF(VRAM)
298298
xor a
299299
call ByteFill
300300

mobile/mobile_40.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2404,7 +2404,7 @@ MACRO macro_100fc0
24042404
; Bit 7 set: Not SRAM
24052405
; Lower 7 bits: Bank if SRAM
24062406
; address, size[, OT address]
2407-
db ($80 * (\1 >= SRAM_End)) | (BANK(\1) * (\1 < SRAM_End))
2407+
db ($80 * (\1 >= STARTOF(SRAM) + SIZEOF(SRAM))) | (BANK(\1) * (\1 < STARTOF(SRAM) + SIZEOF(SRAM)))
24082408
dw \1, \2
24092409
if _NARG == 3
24102410
dw \3

ram/hram.asm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,3 +190,5 @@ hFunctionTargetHi:: db
190190
hCodeBuffer:: ds 3
191191

192192
ds 10
193+
194+
ENDSECTION

ram/sram.asm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,3 +399,5 @@ s7_a001:: db
399399
ds $7fe
400400

401401
sMobileAdapterStatus2:: db
402+
403+
ENDSECTION

ram/vram.asm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ vTiles4:: ds $80 tiles
1414
vTiles5:: ds $80 tiles
1515
vBGMap2:: ds BG_MAP_WIDTH * BG_MAP_HEIGHT
1616
vBGMap3:: ds BG_MAP_WIDTH * BG_MAP_HEIGHT
17+
18+
ENDSECTION

ram/wram.asm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3748,3 +3748,5 @@ SECTION "Stack RAM", WRAMX
37483748

37493749
wWindowStack:: ds $1000 - 1
37503750
wWindowStackBottom:: ds 1
3751+
3752+
ENDSECTION

rgbdscheck.asm

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
1-
MAJOR EQU 0
2-
MINOR EQU 6
3-
PATCH EQU 0
4-
5-
WRONG_RGBDS EQUS "fail \"pokecrystal requires rgbds v0.6.0 or newer.\""
6-
71
IF !DEF(__RGBDS_MAJOR__) || !DEF(__RGBDS_MINOR__) || !DEF(__RGBDS_PATCH__)
8-
WRONG_RGBDS
9-
ELSE
10-
IF (__RGBDS_MAJOR__ < MAJOR) || \
11-
(__RGBDS_MAJOR__ == MAJOR && __RGBDS_MINOR__ < MINOR) || \
12-
(__RGBDS_MAJOR__ == MAJOR && __RGBDS_MINOR__ == MINOR && __RGBDS_PATCH__ < PATCH) || \
13-
(__RGBDS_MAJOR__ == MAJOR && __RGBDS_MINOR__ == MINOR && __RGBDS_PATCH__ == PATCH && DEF(__RGBDS_RC__))
14-
WRONG_RGBDS
2+
fail "pokecrystal requires rgbds v0.7.0 or newer."
153
ENDC
4+
IF __RGBDS_MAJOR__ == 0 && __RGBDS_MINOR__ < 7
5+
fail "pokecrystal requires rgbds v0.7.0 or newer."
166
ENDC

0 commit comments

Comments
 (0)