Update to rgbds v0.7.0

This commit is contained in:
Rangi 2024-01-03 10:58:53 -05:00 committed by xCrystal
parent 3e952c0b0f
commit 0df29e5aaf
22 changed files with 61 additions and 72 deletions

View File

@ -16,7 +16,7 @@ jobs:
uses: actions/checkout@master uses: actions/checkout@master
with: with:
path: rgbds path: rgbds
ref: v0.6.1 ref: v0.7.0
repository: gbdev/rgbds repository: gbdev/rgbds
- name: Install rgbds - name: Install rgbds

6
FAQ.md
View File

@ -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.6.0**][rgbds] or newer. Older versions will not work. Download [**rgbds 0.7.0**][rgbds] or newer. Older versions will not work.
### "ERROR: Macro not defined" ### "ERROR: Macro not defined"
Download [**rgbds 0.6.0**][rgbds] or newer. Older versions will not work. Download [**rgbds 0.7.0**][rgbds] or newer. Older versions will not work.
### "Expression must be 8-bit" ### "Expression must be 8-bit"
Download [**rgbds 0.6.0**][rgbds] or newer. Older versions will not work. Download [**rgbds 0.7.0**][rgbds] or newer. Older versions will not work.
### "Segmentation fault" from `rgbgfx` ### "Segmentation fault" from `rgbgfx`

View File

@ -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.6.1**. Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#pre-built) for Windows with Cygwin to install **rgbds 0.7.0**.
**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. **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.
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.6.1**. Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#pre-built) for macOS to install **rgbds 0.7.0**.
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.6.1** from source. Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.7.0** 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.6.1** from source. Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.7.0** from source.
### Arch Linux ### Arch Linux
@ -104,9 +104,7 @@ To install the software required for **pokecrystal**:
sudo pacman -S make gcc git rgbds sudo pacman -S make gcc git rgbds
``` ```
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#pre-built) for Arch Linux to install **rgbds 0.6.1**. 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.
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.
### Termux ### Termux
@ -122,7 +120,7 @@ To install **rgbds**:
sudo apt install rgbds sudo apt 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.6.1** 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.7.0** from source.
### Other distros ### Other distros
@ -133,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.6.1** 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.7.0** from source.
Now you're ready to [build **pokecrystal**](#build-pokecrystal). Now you're ready to [build **pokecrystal**](#build-pokecrystal).
@ -161,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.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`: 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`:
```bash ```bash
make RGBDS=rgbds-0.6.1/ make RGBDS=rgbds-0.7.0/
``` ```
```bash ```bash
make RGBDS=rgbds-0.6.1/ crystal11 make RGBDS=rgbds-0.7.0/ crystal11
``` ```

View File

@ -102,7 +102,7 @@ tools:
$(MAKE) -C tools/ $(MAKE) -C tools/
RGBASMFLAGS = -hL -Q8 -P includes.asm -Weverything -Wnumeric-string=2 -Wtruncation=1 RGBASMFLAGS = -Q8 -P includes.asm -Weverything -Wnumeric-string=2 -Wtruncation=1
# Create a sym/map for debug purposes if `make` run with `DEBUG=1` # Create a sym/map for debug purposes if `make` run with `DEBUG=1`
ifeq ($(DEBUG),1) ifeq ($(DEBUG),1)
RGBASMFLAGS += -E RGBASMFLAGS += -E

View File

@ -3,19 +3,6 @@
; https://github.com/gbdev/hardware.inc ; https://github.com/gbdev/hardware.inc
; http://gameboy.mongenel.com/dmg/asmmemmap.html ; http://gameboy.mongenel.com/dmg/asmmemmap.html
; memory map
DEF VRAM_Begin EQU $8000
DEF VRAM_End EQU $a000
DEF SRAM_Begin EQU $a000
DEF SRAM_End EQU $c000
DEF WRAM0_Begin EQU $c000
DEF WRAM0_End EQU $d000
DEF WRAM1_Begin EQU $d000
DEF WRAM1_End EQU $e000
; hardware registers $ff00-$ff80 (see below)
DEF HRAM_Begin EQU $ff80
DEF HRAM_End EQU $ffff
; MBC3 ; MBC3
DEF MBC3SRamEnable EQU $0000 DEF MBC3SRamEnable EQU $0000
DEF MBC3RomBank EQU $2000 DEF MBC3RomBank EQU $2000

View File

@ -22,3 +22,5 @@ INCBIN "maps/DebugLevel4_Map1.blk"
DebugLevel5_Map1_Blocks: DebugLevel5_Map1_Blocks:
INCBIN "maps/DebugLevel5_Map1.blk" INCBIN "maps/DebugLevel5_Map1.blk"
endc endc
ENDSECTION

View File

@ -10,3 +10,5 @@ INCLUDE "maps/DebugLevel3_Map1.asm"
INCLUDE "maps/DebugLevel4_Map1.asm" INCLUDE "maps/DebugLevel4_Map1.asm"
INCLUDE "maps/DebugLevel5_Map1.asm" INCLUDE "maps/DebugLevel5_Map1.asm"
endc endc
ENDSECTION

View File

@ -2679,8 +2679,8 @@ If `IsInArray` returns `nc`, data at `bc` will be executed as code.
push af push af
ldh [rSVBK], a ldh [rSVBK], a
xor a xor a
ld hl, WRAM1_Begin ld hl, STARTOF(WRAMX)
ld bc, WRAM1_End - WRAM1_Begin ld bc, SIZEOF(WRAMX)
call ByteFill call ByteFill
pop af pop af
inc a inc a

View File

@ -121,15 +121,15 @@ endr
DebugColor_InitVRAM: DebugColor_InitVRAM:
ld a, $1 ld a, $1
ldh [rVBK], a ldh [rVBK], a
ld hl, VRAM_Begin ld hl, STARTOF(VRAM)
ld bc, VRAM_End - VRAM_Begin ld bc, SIZEOF(VRAM)
xor a xor a
call ByteFill call ByteFill
ld a, $0 ld a, $0
ldh [rVBK], a ldh [rVBK], a
ld hl, VRAM_Begin ld hl, STARTOF(VRAM)
ld bc, VRAM_End - VRAM_Begin ld bc, SIZEOF(VRAM)
xor a xor a
call ByteFill call ByteFill

View File

@ -1,6 +1,6 @@
WriteOAMDMACodeToHRAM:: WriteOAMDMACodeToHRAM::
ld c, LOW(hTransferShadowOAM) ld c, LOW(hTransferShadowOAM)
ld b, OAMDMACodeEnd - OAMDMACode ld b, OAMDMACode.End - OAMDMACode
ld hl, OAMDMACode ld hl, OAMDMACode
.copy .copy
ld a, [hli] ld a, [hli]
@ -25,4 +25,4 @@ hTransferShadowOAM::
jr nz, .wait jr nz, .wait
ret ret
ENDL ENDL
OAMDMACodeEnd: .End:

View File

@ -7,8 +7,8 @@ endr
.EmptyBank: .EmptyBank:
call OpenSRAM call OpenSRAM
ld hl, SRAM_Begin ld hl, STARTOF(SRAM)
ld bc, SRAM_End - SRAM_Begin ld bc, SIZEOF(SRAM)
xor a xor a
call ByteFill call ByteFill
call CloseSRAM call CloseSRAM

View File

@ -39,8 +39,8 @@ _ResetWRAM:
xor a xor a
call ByteFill call ByteFill
ld hl, WRAM1_Begin ld hl, STARTOF(WRAMX)
ld bc, wGameData - WRAM1_Begin ld bc, wGameData - STARTOF(WRAMX)
xor a xor a
call ByteFill call ByteFill

View File

@ -165,15 +165,15 @@ RunTradeAnimScript:
ld a, $1 ld a, $1
ldh [rVBK], a ldh [rVBK], a
ld hl, vTiles0 ld hl, STARTOF(VRAM)
ld bc, VRAM_End - VRAM_Begin ld bc, SIZEOF(VRAM)
xor a xor a
call ByteFill call ByteFill
ld a, $0 ld a, $0
ldh [rVBK], a ldh [rVBK], a
hlbgcoord 0, 0 hlbgcoord 0, 0
ld bc, VRAM_End - vBGMap0 ld bc, STARTOF(VRAM) + SIZEOF(VRAM) - vBGMap0
ld a, " " ld a, " "
call ByteFill call ByteFill
ld hl, TradeGameBoyLZ ld hl, TradeGameBoyLZ
@ -467,7 +467,7 @@ TradeAnim_TubeToPlayer8:
call DisableLCD call DisableLCD
callfar ClearSpriteAnims callfar ClearSpriteAnims
hlbgcoord 0, 0 hlbgcoord 0, 0
ld bc, VRAM_End - vBGMap0 ld bc, STARTOF(VRAM) + SIZEOF(VRAM) - vBGMap0
ld a, " " ld a, " "
call ByteFill call ByteFill
xor a xor a

View File

@ -107,9 +107,9 @@ HDMATransfer_FillBGMap0WithBlack:
ldh [rHDMA1], a ldh [rHDMA1], a
ld a, LOW(wDecompressScratch) ld a, LOW(wDecompressScratch)
ldh [rHDMA2], a ldh [rHDMA2], a
ld a, HIGH(vBGMap0 - VRAM_Begin) ld a, HIGH(vBGMap0 - STARTOF(VRAM))
ldh [rHDMA3], a ldh [rHDMA3], a
ld a, LOW(vBGMap0 - VRAM_Begin) ld a, LOW(vBGMap0 - STARTOF(VRAM))
ldh [rHDMA4], a ldh [rHDMA4], a
ld a, $3f ld a, $3f
ldh [hDMATransfer], a ldh [hDMATransfer], a

View File

@ -68,3 +68,5 @@ Start::
; This makes sure it doesn't get used for anything else. ; This makes sure it doesn't get used for anything else.
ds $0150 - @, $00 ds $0150 - @, $00
ENDSECTION

View File

@ -64,8 +64,8 @@ Init::
ldh [rLCDC], a ldh [rLCDC], a
; Clear WRAM bank 0 ; Clear WRAM bank 0
ld hl, WRAM0_Begin ld hl, STARTOF(WRAM0)
ld bc, WRAM0_End - WRAM0_Begin ld bc, SIZEOF(WRAM0)
.ByteFill: .ByteFill:
ld [hl], 0 ld [hl], 0
inc hl inc hl
@ -82,8 +82,8 @@ Init::
ldh a, [hSystemBooted] ldh a, [hSystemBooted]
push af push af
xor a xor a
ld hl, HRAM_Begin ld hl, STARTOF(HRAM)
ld bc, HRAM_End - HRAM_Begin ld bc, SIZEOF(HRAM)
call ByteFill call ByteFill
pop af pop af
ldh [hSystemBooted], a ldh [hSystemBooted], a
@ -172,8 +172,8 @@ ClearVRAM::
xor a ; 0 xor a ; 0
ldh [rVBK], a ldh [rVBK], a
.clear .clear
ld hl, VRAM_Begin ld hl, STARTOF(VRAM)
ld bc, VRAM_End - VRAM_Begin ld bc, SIZEOF(VRAM)
xor a xor a
call ByteFill call ByteFill
ret ret
@ -187,8 +187,8 @@ ClearWRAM::
push af push af
ldh [rSVBK], a ldh [rSVBK], a
xor a xor a
ld hl, WRAM1_Begin ld hl, STARTOF(WRAMX)
ld bc, WRAM1_End - WRAM1_Begin ld bc, SIZEOF(WRAMX)
call ByteFill call ByteFill
pop af pop af
inc a inc a

View File

@ -263,8 +263,8 @@ ClearVBank1::
ld a, 1 ld a, 1
ldh [rVBK], a ldh [rVBK], a
ld hl, VRAM_Begin ld hl, STARTOF(VRAM)
ld bc, VRAM_End - VRAM_Begin ld bc, SIZEOF(VRAM)
xor a xor a
call ByteFill call ByteFill

View File

@ -158,3 +158,5 @@ hWindowHUDLY::
db db
hCurBoardEvent:: db hCurBoardEvent:: db
ENDSECTION

View File

@ -145,3 +145,5 @@ sDisabledSpacesBackups:: ds wDisabledSpacesBackupsEnd - wDisabledSpacesBackups
SECTION "SRAM Map Objects Backups", SRAM SECTION "SRAM Map Objects Backups", SRAM
sMapObjectsBackups:: ds wMapObjectsBackupsEnd - wMapObjectsBackups sMapObjectsBackups:: ds wMapObjectsBackupsEnd - wMapObjectsBackups
ENDSECTION

View File

@ -14,3 +14,5 @@ vTiles4:: ds $80 tiles
vTiles5:: ds $80 tiles vTiles5:: ds $80 tiles
vBGMap2:: ds BG_MAP_WIDTH * BG_MAP_HEIGHT vBGMap2:: ds BG_MAP_WIDTH * BG_MAP_HEIGHT
vBGMap3:: ds BG_MAP_WIDTH * BG_MAP_HEIGHT vBGMap3:: ds BG_MAP_WIDTH * BG_MAP_HEIGHT
ENDSECTION

View File

@ -2852,3 +2852,5 @@ SECTION "Stack RAM", WRAMX
wWindowStack:: ds $1000 - 1 wWindowStack:: ds $1000 - 1
wWindowStackBottom:: ds 1 wWindowStackBottom:: ds 1
ENDSECTION

View File

@ -1,16 +1,6 @@
MAJOR EQU 0
MINOR EQU 6
PATCH EQU 0
WRONG_RGBDS EQUS "fail \"pokecrystal requires rgbds v0.6.0 or newer.\""
IF !DEF(__RGBDS_MAJOR__) || !DEF(__RGBDS_MINOR__) || !DEF(__RGBDS_PATCH__) IF !DEF(__RGBDS_MAJOR__) || !DEF(__RGBDS_MINOR__) || !DEF(__RGBDS_PATCH__)
WRONG_RGBDS fail "pokecrystal requires rgbds v0.7.0 or newer."
ELSE
IF (__RGBDS_MAJOR__ < MAJOR) || \
(__RGBDS_MAJOR__ == MAJOR && __RGBDS_MINOR__ < MINOR) || \
(__RGBDS_MAJOR__ == MAJOR && __RGBDS_MINOR__ == MINOR && __RGBDS_PATCH__ < PATCH) || \
(__RGBDS_MAJOR__ == MAJOR && __RGBDS_MINOR__ == MINOR && __RGBDS_PATCH__ == PATCH && DEF(__RGBDS_RC__))
WRONG_RGBDS
ENDC ENDC
IF __RGBDS_MAJOR__ == 0 && __RGBDS_MINOR__ < 7
fail "pokecrystal requires rgbds v0.7.0 or newer."
ENDC ENDC