summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRangi <35663410+Rangi42@users.noreply.github.com>2020-07-22 09:11:20 -0400
committerGitHub <noreply@github.com>2020-07-22 09:11:20 -0400
commit96d38a1b9ccb843996fa887643b3ee59597982d0 (patch)
tree5ea71642d430d43295b72ab121a003cd33236849
parent60b0f0039de412bef28d5bbb5311e0d187980194 (diff)
parentb6bb40fcaff37dc7586719bc0862149312e3b042 (diff)
Merge pull request #57 from Rangi42/master
Use LOAD/ENDL for OAM DMA code in HRAM (requires rgbds 0.4.1)
-rw-r--r--.travis.yml2
-rw-r--r--INSTALL.md8
-rw-r--r--engine/battle/effect_commands.asm2
-rw-r--r--engine/gfx/load_push_oam.asm23
-rw-r--r--hram.asm2
-rw-r--r--layout.link1
6 files changed, 22 insertions, 16 deletions
diff --git a/.travis.yml b/.travis.yml
index a98b03f0..4b8f4c7c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -5,7 +5,7 @@ os:
install:
- |-
( cd
- git clone -b v0.4.0 --depth=1 https://github.com/rednex/rgbds
+ git clone -b v0.4.1 --depth=1 https://github.com/rednex/rgbds
sudo make -C rgbds install
rm -rf rgbds
)
diff --git a/INSTALL.md b/INSTALL.md
index 1382e13e..85096767 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -36,7 +36,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.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.
+**Note: If you already have an older rgbds, you will need to update to 0.4.1.** Ignore this if you have never installed rgbds before. If a version newer than 0.4.1 does not work, try downloading 0.4.1.
Now open the **Cygwin terminal** and enter the following commands.
@@ -82,7 +82,7 @@ To install **rgbds**:
```bash
sudo apt-get install pkg-config flex bison libpng-dev
-git clone -b v0.4.0 --depth=1 https://github.com/rednex/rgbds
+git clone -b v0.4.1 --depth=1 https://github.com/rednex/rgbds
sudo make -C rgbds install
```
@@ -98,7 +98,7 @@ To install **rgbds**:
```bash
sudo zypper install pkg-config flex bison libpng16-devel
-git clone -b v0.4.0 --depth=1 https://github.com/rednex/rgbds
+git clone -b v0.4.1 --depth=1 https://github.com/rednex/rgbds
sudo make -C rgbds install
```
@@ -121,7 +121,7 @@ If `rgbds` is not available, you'll also need these:
To install **rgbds**:
```bash
-git clone -b v0.4.0 --depth=1 https://github.com/rednex/rgbds
+git clone -b v0.4.1 --depth=1 https://github.com/rednex/rgbds
sudo make -C rgbds install
```
diff --git a/engine/battle/effect_commands.asm b/engine/battle/effect_commands.asm
index 4ecd8d44..ad943ab7 100644
--- a/engine/battle/effect_commands.asm
+++ b/engine/battle/effect_commands.asm
@@ -2526,7 +2526,7 @@ EndMoveEffect:
ld l, a
ld a, [wBattleScriptBufferAddress + 1]
ld h, a
- ld a, $ff
+ ld a, endmove_command
ld [hli], a
ld [hli], a
ld [hl], a
diff --git a/engine/gfx/load_push_oam.asm b/engine/gfx/load_push_oam.asm
index 2e43c1ff..39518881 100644
--- a/engine/gfx/load_push_oam.asm
+++ b/engine/gfx/load_push_oam.asm
@@ -1,21 +1,28 @@
WriteOAMDMACodeToHRAM::
ld c, LOW(hTransferVirtualOAM)
- ld b, .PushOAMEnd - .PushOAM
- ld hl, .PushOAM
-.loop
+ ld b, OAMDMACodeEnd - OAMDMACode
+ ld hl, OAMDMACode
+.copy
ld a, [hli]
ldh [c], a
inc c
dec b
- jr nz, .loop
+ jr nz, .copy
ret
-.PushOAM:
+OAMDMACode:
+; This code is defined in ROM, but
+; copied to and called from HRAM.
+LOAD "OAM DMA", HRAM
+hTransferVirtualOAM::
+ ; initiate DMA
ld a, HIGH(wVirtualOAM)
ldh [rDMA], a
+ ; wait for DMA to finish
ld a, NUM_SPRITE_OAM_STRUCTS
-.pushoam_loop
+.wait
dec a
- jr nz, .pushoam_loop
+ jr nz, .wait
ret
-.PushOAMEnd
+ENDL
+OAMDMACodeEnd:
diff --git a/hram.asm b/hram.asm
index 3b3b3df6..2b3c07f2 100644
--- a/hram.asm
+++ b/hram.asm
@@ -1,7 +1,5 @@
SECTION "HRAM", HRAM
-hTransferVirtualOAM:: ds 10
-
ds 5
hRTCDayHi:: db
diff --git a/layout.link b/layout.link
index 866780e8..d740a955 100644
--- a/layout.link
+++ b/layout.link
@@ -290,4 +290,5 @@ SRAM $03
"Boxes 8-14"
"Backup Save 3"
HRAM
+ "OAM DMA"
"HRAM"