WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 5943b96

Browse files
authored
Use features of RGBDS 1.0.0 (#537)
1 parent 8105df9 commit 5943b96

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+378
-375
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.9.3
19+
ref: v1.0.0
2020
repository: gbdev/rgbds
2121

2222
- name: Install rgbds

.rgbds-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.9.3
1+
1.0.0

INSTALL.md

Lines changed: 10 additions & 10 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** install instructions](https://rgbds.gbdev.io/install#pre-built) for Windows with Cygwin to install **rgbds 0.9.3**.
45+
Then follow the [**rgbds** install instructions](https://rgbds.gbdev.io/install#pre-built) for Windows with Cygwin to install **rgbds 1.0.0**.
4646

47-
**Note:** If you already have an installed rgbds older than 0.9.3, you will need to update to 0.9.3. Ignore this if you have never installed rgbds before. If a version newer than 0.9.3 does not work, try downloading 0.9.3.
47+
**Note:** If you already have an installed rgbds older than 1.0.0, you will need to update to 1.0.0. Ignore this if you have never installed rgbds before. If a version newer than 1.0.0 does not work, try downloading 1.0.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.9.3**.
70+
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#pre-built) for macOS to install **rgbds 1.0.0**.
7171

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

@@ -84,7 +84,7 @@ To install the software required for **pokered**:
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.9.3** from source.
87+
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 1.0.0** from source.
8888

8989
### OpenSUSE
9090

@@ -94,7 +94,7 @@ To install the software required for **pokered**:
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.9.3** from source.
97+
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 1.0.0** from source.
9898

9999
### Arch Linux
100100

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

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.9.3** 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 1.0.0** from source.
108108

109109
### Termux
110110

@@ -120,7 +120,7 @@ To install **rgbds**:
120120
pkg install rgbds
121121
```
122122

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.9.3** 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 1.0.0** from source.
124124

125125
### Other distros
126126

@@ -131,7 +131,7 @@ If your distro is not listed here, try to find the required software in its repo
131131
- `git`
132132
- `rgbds`
133133

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.9.3** 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 1.0.0** from source.
135135

136136
Now you're ready to [build **pokered**](#build-pokered).
137137

@@ -153,8 +153,8 @@ make
153153

154154
### Build with a local rgbds version
155155

156-
If you have different projects that require different versions of `rgbds`, it might not be convenient to install rgbds 0.9.3 globally. Instead, you can put its files in a directory within pokered, such as `pokered/rgbds-0.9.3/`. Then specify it when you run `make`:
156+
If you have different projects that require different versions of `rgbds`, it might not be convenient to install rgbds 1.0.0 globally. Instead, you can put its files in a directory within pokered, such as `pokered/rgbds-1.0.0/`. Then specify it when you run `make`:
157157

158158
```bash
159-
make RGBDS=rgbds-0.9.3/
159+
make RGBDS=rgbds-1.0.0/
160160
```

Makefile

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ RGBFIX ?= $(RGBDS)rgbfix
3838
RGBGFX ?= $(RGBDS)rgbgfx
3939
RGBLINK ?= $(RGBDS)rgblink
4040

41+
RGBASMFLAGS ?= -Weverything -Wtruncation=1
42+
RGBLINKFLAGS ?= -Weverything -Wtruncation=1
43+
RGBFIXFLAGS ?= -Weverything
44+
RGBGFXFLAGS ?= -Weverything
45+
4146

4247
### Build targets
4348

@@ -85,7 +90,7 @@ tools:
8590
$(MAKE) -C tools/
8691

8792

88-
RGBASMFLAGS = -Q8 -P includes.asm -Weverything -Wtruncation=1
93+
RGBASMFLAGS += -Q8 -P includes.asm
8994
# Create a sym/map for debug purposes if `make` run with `DEBUG=1`
9095
ifeq ($(DEBUG),1)
9196
RGBASMFLAGS += -E
@@ -128,35 +133,37 @@ $(foreach obj, $(pokeblue_vc_obj), $(eval $(call DEP,$(obj),$(obj:_blue_vc.o=.as
128133
endif
129134

130135

131-
pokered_pad = 0x00
132-
pokeblue_pad = 0x00
133-
pokered_vc_pad = 0x00
134-
pokeblue_vc_pad = 0x00
135-
pokeblue_debug_pad = 0xff
136+
RGBLINKFLAGS += -d
137+
pokered.gbc: RGBLINKFLAGS += -p 0x00
138+
pokeblue.gbc: RGBLINKFLAGS += -p 0x00
139+
pokeblue_debug.gbc: RGBLINKFLAGS += -p 0xff
140+
pokered_vc.gbc: RGBLINKFLAGS += -p 0x00
141+
pokeblue_vc.gbc: RGBLINKFLAGS += -p 0x00
136142

137-
pokered_opt = -jsv -n 0 -k 01 -l 0x33 -m MBC3+RAM+BATTERY -r 03 -t "POKEMON RED"
138-
pokeblue_opt = -jsv -n 0 -k 01 -l 0x33 -m MBC3+RAM+BATTERY -r 03 -t "POKEMON BLUE"
139-
pokeblue_debug_opt = -jsv -n 0 -k 01 -l 0x33 -m MBC3+RAM+BATTERY -r 03 -t "POKEMON BLUE"
140-
pokered_vc_opt = -jsv -n 0 -k 01 -l 0x33 -m MBC3+RAM+BATTERY -r 03 -t "POKEMON RED"
141-
pokeblue_vc_opt = -jsv -n 0 -k 01 -l 0x33 -m MBC3+RAM+BATTERY -r 03 -t "POKEMON BLUE"
143+
RGBFIXFLAGS += -jsv -n 0 -k 01 -l 0x33 -m MBC3+RAM+BATTERY -r 03
144+
pokered.gbc: RGBFIXFLAGS += -p 0x00 -t "POKEMON RED"
145+
pokeblue.gbc: RGBFIXFLAGS += -p 0x00 -t "POKEMON BLUE"
146+
pokeblue_debug.gbc: RGBFIXFLAGS += -p 0xff -t "POKEMON BLUE"
147+
pokered_vc.gbc: RGBFIXFLAGS += -p 0x00 -t "POKEMON RED"
148+
pokeblue_vc.gbc: RGBFIXFLAGS += -p 0x00 -t "POKEMON BLUE"
142149

143150
%.gbc: $$(%_obj) layout.link
144-
$(RGBLINK) -p $($*_pad) -d -m $*.map -n $*.sym -l layout.link -o $@ $(filter %.o,$^)
145-
$(RGBFIX) -p $($*_pad) $($*_opt) $@
151+
$(RGBLINK) $(RGBLINKFLAGS) -l layout.link -m $*.map -n $*.sym -o $@ $(filter %.o,$^)
152+
$(RGBFIX) $(RGBFIXFLAGS) $@
146153

147154

148155
### Misc file-specific graphics rules
149156

150157
gfx/battle/move_anim_0.2bpp: tools/gfx += --trim-whitespace
151158
gfx/battle/move_anim_1.2bpp: tools/gfx += --trim-whitespace
152159

153-
gfx/intro/blue_jigglypuff_1.2bpp: rgbgfx += --columns
154-
gfx/intro/blue_jigglypuff_2.2bpp: rgbgfx += --columns
155-
gfx/intro/blue_jigglypuff_3.2bpp: rgbgfx += --columns
156-
gfx/intro/red_nidorino_1.2bpp: rgbgfx += --columns
157-
gfx/intro/red_nidorino_2.2bpp: rgbgfx += --columns
158-
gfx/intro/red_nidorino_3.2bpp: rgbgfx += --columns
159-
gfx/intro/gengar.2bpp: rgbgfx += --columns
160+
gfx/intro/blue_jigglypuff_1.2bpp: RGBGFXFLAGS += --columns
161+
gfx/intro/blue_jigglypuff_2.2bpp: RGBGFXFLAGS += --columns
162+
gfx/intro/blue_jigglypuff_3.2bpp: RGBGFXFLAGS += --columns
163+
gfx/intro/red_nidorino_1.2bpp: RGBGFXFLAGS += --columns
164+
gfx/intro/red_nidorino_2.2bpp: RGBGFXFLAGS += --columns
165+
gfx/intro/red_nidorino_3.2bpp: RGBGFXFLAGS += --columns
166+
gfx/intro/gengar.2bpp: RGBGFXFLAGS += --columns
160167
gfx/intro/gengar.2bpp: tools/gfx += --remove-duplicates --preserve=0x19,0x76
161168

162169
gfx/credits/the_end.2bpp: tools/gfx += --interleave --png=$<
@@ -173,12 +180,12 @@ gfx/trade/game_boy.2bpp: tools/gfx += --remove-duplicates
173180
### Catch-all graphics rules
174181

175182
%.2bpp: %.png
176-
$(RGBGFX) --colors dmg=e4 $(rgbgfx) -o $@ $<
183+
$(RGBGFX) --colors dmg $(RGBGFXFLAGS) -o $@ $<
177184
$(if $(tools/gfx),\
178185
tools/gfx $(tools/gfx) -o $@ $@ || $$($(RM) $@ && false))
179186

180187
%.1bpp: %.png
181-
$(RGBGFX) --colors dmg=e4 $(rgbgfx) --depth 1 -o $@ $<
188+
$(RGBGFX) --colors dmg $(RGBGFXFLAGS) --depth 1 -o $@ $<
182189
$(if $(tools/gfx),\
183190
tools/gfx $(tools/gfx) --depth 1 -o $@ $@ || $$($(RM) $@ && false))
184191

engine/battle/animations.asm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1603,7 +1603,7 @@ _AnimationSquishMonPic:
16031603
call AnimCopyRowRight
16041604
inc hl
16051605
.next
1606-
ld [hl], " "
1606+
ld [hl], ' '
16071607
pop hl
16081608
ld de, SCREEN_WIDTH
16091609
add hl, de
@@ -1838,7 +1838,7 @@ _AnimationSlideMonOff:
18381838
; plus one instead.
18391839
cp $61
18401840
ret c
1841-
ld a, " "
1841+
ld a, ' '
18421842
ret
18431843

18441844
.EnemyNextTile
@@ -1848,7 +1848,7 @@ _AnimationSlideMonOff:
18481848
; the lower right tile is in the first column to slide off the screen.
18491849
cp $30
18501850
ret c
1851-
ld a, " "
1851+
ld a, ' '
18521852
ret
18531853

18541854
AnimationSlideMonHalfOff:

engine/battle/core.asm

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ SlidePlayerAndEnemySilhouettesOnScreen:
2020
ld hl, vBGMap0
2121
ld bc, TILEMAP_AREA
2222
.clearBackgroundLoop
23-
ld a, " "
23+
ld a, ' '
2424
ld [hli], a
2525
dec bc
2626
ld a, b
@@ -1984,11 +1984,11 @@ CenterMonName:
19841984
.loop
19851985
inc de
19861986
ld a, [de]
1987-
cp "@"
1987+
cp '@'
19881988
jr z, .done
19891989
inc de
19901990
ld a, [de]
1991-
cp "@"
1991+
cp '@'
19921992
jr z, .done
19931993
dec hl
19941994
dec b
@@ -2036,15 +2036,15 @@ DisplayBattleMenu::
20362036
call CopyData
20372037
; the following simulates the keystrokes by drawing menus on screen
20382038
hlcoord 9, 14
2039-
ld [hl], "▶"
2039+
ld [hl], '▶'
20402040
ld c, 80
20412041
call DelayFrames
2042-
ld [hl], " "
2042+
ld [hl], ' '
20432043
hlcoord 9, 16
2044-
ld [hl], "▶"
2044+
ld [hl], '▶'
20452045
ld c, 50
20462046
call DelayFrames
2047-
ld [hl], "▷"
2047+
ld [hl], '▷'
20482048
ld a, $2 ; select the "ITEM" menu
20492049
jp .upperLeftMenuItemWasNotSelected
20502050
.oldManName
@@ -2062,7 +2062,7 @@ DisplayBattleMenu::
20622062
.leftColumn ; put cursor in left column of menu
20632063
ld a, [wBattleType]
20642064
cp BATTLE_TYPE_SAFARI
2065-
ld a, " "
2065+
ld a, ' '
20662066
jr z, .safariLeftColumn
20672067
; put cursor in left column for normal battle menu (i.e. when it's not a Safari battle)
20682068
ldcoord_a 15, 14 ; clear upper cursor position in right column
@@ -2095,7 +2095,7 @@ DisplayBattleMenu::
20952095
.rightColumn ; put cursor in right column of menu
20962096
ld a, [wBattleType]
20972097
cp BATTLE_TYPE_SAFARI
2098-
ld a, " "
2098+
ld a, ' '
20992099
jr z, .safariRightColumn
21002100
; put cursor in right column for normal battle menu (i.e. when it's not a Safari battle)
21012101
ldcoord_a 9, 14 ; clear upper cursor position in left column
@@ -2328,7 +2328,7 @@ PartyMenuOrRockOrRun:
23282328
.partyMonDeselected
23292329
hlcoord 11, 11
23302330
ld bc, 6 * SCREEN_WIDTH + 9
2331-
ld a, " "
2331+
ld a, ' '
23322332
call FillMemory
23332333
xor a ; NORMAL_PARTY_MENU
23342334
ld [wPartyMenuTypeOrMessageID], a
@@ -2495,9 +2495,9 @@ MoveSelectionMenu:
24952495
; so it is necessary to put the di ei block to not cause tearing
24962496
call TextBoxBorder
24972497
hlcoord 4, 12
2498-
ld [hl], "─"
2498+
ld [hl], '─'
24992499
hlcoord 10, 12
2500-
ld [hl], "┘"
2500+
ld [hl], '┘'
25012501
ei
25022502
hlcoord 6, 13
25032503
call .writemoves
@@ -2603,7 +2603,7 @@ SelectMenuItem:
26032603
dec a
26042604
ld bc, SCREEN_WIDTH
26052605
call AddNTimes
2606-
ld [hl], "▷"
2606+
ld [hl], '▷'
26072607
.select
26082608
ld hl, hUILayoutFlags
26092609
set BIT_DOUBLE_SPACED_MENU, [hl]
@@ -2886,9 +2886,9 @@ PrintMenuItem:
28862886
ld de, TypeText
28872887
call PlaceString
28882888
hlcoord 7, 11
2889-
ld [hl], "/"
2889+
ld [hl], '/'
28902890
hlcoord 5, 9
2891-
ld [hl], "/"
2891+
ld [hl], '/'
28922892
hlcoord 5, 11
28932893
ld de, wBattleMenuCurrentPP
28942894
lb bc, 1, 2
@@ -6841,17 +6841,17 @@ InitWildBattle:
68416841
ld [hli], a ; write front sprite pointer
68426842
ld [hl], b
68436843
ld hl, wEnemyMonNick ; set name to "GHOST"
6844-
ld a, "G"
6844+
ld a, 'G'
68456845
ld [hli], a
6846-
ld a, "H"
6846+
ld a, 'H'
68476847
ld [hli], a
6848-
ld a, "O"
6848+
ld a, 'O'
68496849
ld [hli], a
6850-
ld a, "S"
6850+
ld a, 'S'
68516851
ld [hli], a
6852-
ld a, "T"
6852+
ld a, 'T'
68536853
ld [hli], a
6854-
ld [hl], "@"
6854+
ld [hl], '@'
68556855
ld a, [wCurPartySpecies]
68566856
push af
68576857
ld a, MON_GHOST

engine/battle/effects.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ FellText:
743743

744744
PrintStatText:
745745
ld hl, StatModTextStrings
746-
ld c, "@"
746+
ld c, '@'
747747
.findStatName_outer
748748
dec b
749749
jr z, .foundStatName

engine/battle/link_battle_versus_text.asm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ DisplayLinkBattleVersusTextBox:
1313
call PlaceString
1414
; place bold "VS" tiles between the names
1515
hlcoord 9, 8
16-
ld a, "<BOLD_V>"
16+
ld a, '<BOLD_V>'
1717
ld [hli], a
18-
ld [hl], "<BOLD_S>"
18+
ld [hl], '<BOLD_S>'
1919
xor a
2020
ld [wUpdateSpritesEnabled], a
2121
callfar SetupPlayerAndEnemyPokeballs

engine/battle/misc.asm

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ FormatMovesString:
1717
ld hl, wNameBuffer
1818
.copyNameLoop
1919
ld a, [hli]
20-
cp "@"
20+
cp '@'
2121
jr z, .doneCopyingName
2222
ld [de], a
2323
inc de
@@ -26,7 +26,7 @@ FormatMovesString:
2626
ld a, b
2727
ld [wNumMovesMinusOne], a
2828
inc b
29-
ld a, "<NEXT>"
29+
ld a, '<NEXT>'
3030
ld [de], a
3131
inc de
3232
pop hl
@@ -35,19 +35,19 @@ FormatMovesString:
3535
jr z, .done
3636
jr .printMoveNameLoop
3737
.printDashLoop
38-
ld a, "-"
38+
ld a, '-'
3939
ld [de], a
4040
inc de
4141
inc b
4242
ld a, b
4343
cp NUM_MOVES
4444
jr z, .done
45-
ld a, "<NEXT>"
45+
ld a, '<NEXT>'
4646
ld [de], a
4747
inc de
4848
jr .printDashLoop
4949
.done
50-
ld a, "@"
50+
ld a, '@'
5151
ld [de], a
5252
ret
5353

0 commit comments

Comments
 (0)