Skip to content

Commit

Permalink
Require rgbds 0.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Rangi42 committed Oct 3, 2022
1 parent 4c7bea9 commit e64b4ac
Show file tree
Hide file tree
Showing 22 changed files with 30 additions and 80 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get install make python gcc git bison
git clone -b v0.6.0-rc2 --depth=1 https://github.com/gbdev/rgbds
git clone -b v0.6.0 --depth=1 https://github.com/gbdev/rgbds
pushd rgbds
git fetch
git checkout 3e945679ad615692c3e9c07f52a21922b561c9a6
Expand Down
2 changes: 1 addition & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ cd polishedcrystal
mkdir rgbds
```

Then download [**rgbds**](https://rgbds.gbdev.io/). If you're building Polished Crystal 2.2.0, get rgbds version 0.3.9. If you're building the 3.0.0 beta, you'll need version **0.6.0-rc2**. Extract the archive and put all the .exe and .dll files in polishedcrystal/rgbds.
Then download [**rgbds**](https://rgbds.gbdev.io/). If you're building Polished Crystal 2.2.0, get rgbds version 0.3.9. If you're building the 3.0.0 beta, you'll need version **0.6.0**. Extract the archive and put all the .exe and .dll files in polishedcrystal/rgbds.

To build **polishedcrystal.gbc**:

Expand Down
44 changes: 22 additions & 22 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Q :=

.SECONDEXPANSION:

RGBASM_FLAGS = -EhL -Q8 -Weverything -Wnumeric-string=2 -Wtruncation=1
RGBASM_FLAGS = -EhL -Q8 -P constants.asm -Weverything -Wnumeric-string=2 -Wtruncation=1
RGBASM_VC_FLAGS = $(RGBASM_FLAGS) -DVIRTUAL_CONSOLE
RGBLINK_FLAGS = -M -n $(ROM_NAME).sym -m $(ROM_NAME).map -p $(FILLER)
RGBLINK_VC_FLAGS = -M -n $(ROM_NAME)_vc.sym -m $(ROM_NAME)_vc.map -p $(FILLER)
Expand Down Expand Up @@ -64,25 +64,25 @@ RGBASM_FLAGS += -DHUFFMAN
endif

rom_obj := \
main.o \
home.o \
ram.o \
audio.o \
audio/music_player.o \
data/pokemon/dex_entries.o \
data/pokemon/egg_moves.o \
data/pokemon/evos_attacks.o \
data/maps/map_data.o \
data/text/common.o \
data/tilesets.o \
engine/movie/credits.o \
engine/overworld/events.o \
gfx/minis_icons.o \
gfx/pokemon.o \
gfx/sprites.o \
gfx/trainers.o \
gfx/items.o \
gfx/misc.o
main.o \
home.o \
ram.o \
audio.o \
audio/music_player.o \
data/pokemon/dex_entries.o \
data/pokemon/egg_moves.o \
data/pokemon/evos_attacks.o \
data/maps/map_data.o \
data/text/common.o \
data/tilesets.o \
engine/movie/credits.o \
engine/overworld/events.o \
gfx/minis_icons.o \
gfx/pokemon.o \
gfx/sprites.o \
gfx/trainers.o \
gfx/items.o \
gfx/misc.o

crystal_obj := $(rom_obj:.o=.o)
crystal_vc_obj :=$(rom_obj:.o=_vc.o)
Expand Down Expand Up @@ -130,12 +130,12 @@ rgbdscheck.o: rgbdscheck.asm
$Q$(RGBDS_DIR)rgbasm -o $@ $<

define DEP
$1: $2 $$(shell tools/scan_includes $2) | rgbdscheck.o
$1: $2 $$(shell tools/scan_includes $2) | constants.asm rgbdscheck.o
$Q$$(RGBDS_DIR)rgbasm $$(RGBASM_FLAGS) -L -o $$@ $$<
endef

define VCDEP
$1: $2 $$(shell tools/scan_includes $2) | rgbdscheck.o
$1: $2 $$(shell tools/scan_includes $2) | constants.asm rgbdscheck.o
$Q$$(RGBDS_DIR)rgbasm $$(RGBASM_VC_FLAGS) -L -o $$@ $$<
endef

Expand Down
3 changes: 0 additions & 3 deletions audio.asm
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
INCLUDE "constants.asm"


SECTION "Audio", ROMX

INCLUDE "audio/engine.asm"
Expand Down
2 changes: 0 additions & 2 deletions audio/music_player.asm
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
; Written by Sanqui
; https://github.com/froggestspirit/CrystalComplete/blob/master/misc/musicplayer.asm

INCLUDE "constants.asm"

DEF MP_METER0 EQU $20
DEF MP_METER8 EQU $28
DEF MP_DUTY0 EQU $29
Expand Down
3 changes: 0 additions & 3 deletions data/maps/map_data.asm
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
INCLUDE "constants.asm"


SECTION "Map Headers", ROMX

INCLUDE "data/maps/maps.asm"
Expand Down
3 changes: 0 additions & 3 deletions data/pokemon/dex_entries.asm
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
INCLUDE "constants.asm"


SECTION "BulbasaurPokedexEntry", ROMX
BulbasaurPokedexEntry::
db "Seed@"
Expand Down
3 changes: 0 additions & 3 deletions data/pokemon/egg_moves.asm
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
INCLUDE "constants.asm"


SECTION "Egg Moves", ROMX

INCLUDE "data/pokemon/egg_move_pointers.asm"
Expand Down
3 changes: 1 addition & 2 deletions data/pokemon/evos_attacks.asm
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
INCLUDE "constants.asm"

MACRO evo_data
db \1, \2 ; evolution type, parameter
if (\1 == EVOLVE_STAT) || (\1 == EVOLVE_HOLDING)
Expand All @@ -13,6 +11,7 @@ MACRO evo_data
endc
ENDM


SECTION "Evolutions and Attacks", ROMX

INCLUDE "data/pokemon/evolution_moves.asm"
Expand Down
3 changes: 0 additions & 3 deletions data/text/common.asm
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
INCLUDE "constants.asm"


SECTION "_FruitBearingTreeText", ROMX
_FruitBearingTreeText::
text "It's a fruit-"
Expand Down
3 changes: 0 additions & 3 deletions data/tilesets.asm
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
INCLUDE "constants.asm"


SECTION "Tileset Headers", ROMX

MACRO tileset
Expand Down
5 changes: 1 addition & 4 deletions engine/events/magikarp.asm
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,7 @@ PrintMagikarpLength:
ld b, a
ld a, [wMagikarpLengthMmLo]
ld c, a
pusho
opt Q16
ld de, div(1.0, 25.4) ; 1 in / 25.4 mm = 0.03937 in/mm
popo
ld de, div(1.0q16, 25.4q16, 16) ; 1 in / 25.4 mm = 0.03937 in/mm
xor a
ldh [hTmpd], a
ldh [hTmpe], a
Expand Down
4 changes: 2 additions & 2 deletions engine/math/sine.asm
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ _Sine::
ret

.sinewave
; sample sin(x) from x=0 to x=pi radians
; sample sin(x) from x=0 to x=0.5 turns (pi radians)
for x, 32
dw sin(x * div(0.5, 32))
dw sin(x * 0.5 / 32)
endr
3 changes: 0 additions & 3 deletions engine/movie/credits.asm
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
INCLUDE "constants.asm"


SECTION "Credits", ROMX

const_def
Expand Down
3 changes: 0 additions & 3 deletions engine/overworld/events.asm
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
INCLUDE "constants.asm"


SECTION "Events", ROMX

OverworldLoop::
Expand Down
3 changes: 0 additions & 3 deletions gfx/pokemon.asm
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
INCLUDE "constants.asm"


SECTION "Pokemon Pic Pointers", ROMX

INCLUDE "data/pokemon/pic_pointers.asm"
Expand Down
3 changes: 0 additions & 3 deletions gfx/sprites.asm
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
INCLUDE "constants.asm"


SECTION "ChrisSpriteGFX", ROMX
ChrisSpriteGFX:: INCBIN "gfx/sprites/chris.2bpp.lz"

Expand Down
3 changes: 0 additions & 3 deletions gfx/trainers.asm
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
INCLUDE "constants.asm"


SECTION "Trainer Pic Pointers", ROMX

INCLUDE "data/trainers/pic_pointers.asm"
Expand Down
3 changes: 0 additions & 3 deletions home.asm
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
INCLUDE "constants.asm"


SECTION "NULL", ROM0
NULL::

Expand Down
3 changes: 0 additions & 3 deletions main.asm
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
INCLUDE "constants.asm"


SECTION "bank1", ROMX

INCLUDE "engine/gfx/load_push_oam.asm"
Expand Down
2 changes: 0 additions & 2 deletions ram.asm
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
INCLUDE "constants.asm"

INCLUDE "macros/wram.asm"

INCLUDE "ram/vram.asm"
Expand Down
7 changes: 2 additions & 5 deletions rgbdscheck.asm
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
MAJOR EQU 0
MINOR EQU 6
PATCH EQU 0
RC EQU 2

WRONG_RGBDS EQUS "fail \"polishedcrystal requires rgbds v0.6.0-rc2 or newer.\""
WRONG_RGBDS EQUS "fail \"polishedcrystal requires rgbds v0.6.0 or newer.\""

if !DEF(__RGBDS_MAJOR__) || !DEF(__RGBDS_MINOR__) || !DEF(__RGBDS_PATCH__)
WRONG_RGBDS
Expand All @@ -14,9 +13,7 @@ else
WRONG_RGBDS
else
if DEF(__RGBDS_RC__)
if __RGBDS_RC__ < RC
WRONG_RGBDS
endc
WRONG_RGBDS
endc
endc
endc

0 comments on commit e64b4ac

Please sign in to comment.