Skip to content

Commit

Permalink
Use LOAD/ENDL for OAM DMA code in HRAM (requires rgbds 0.4.1)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rangi42 committed Jul 21, 2020
1 parent 3e554e1 commit 204bf74
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
10 changes: 5 additions & 5 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,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.

Expand Down Expand Up @@ -86,7 +86,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
```

Expand All @@ -102,7 +102,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
```

Expand All @@ -120,7 +120,7 @@ Alternatively, to install **rgbds** manually:

```bash
sudo pacman -S pkg-config flex bison libpng
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
```

Expand Down Expand Up @@ -157,7 +157,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
```

Expand Down
4 changes: 3 additions & 1 deletion engine/gfx/oam_dma.asm
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@ WriteDMACodeToHRAM::
ret

DMARoutine:
LOAD "OAM DMA", HRAM
hDMARoutine::
; initiate DMA
ld a, HIGH(wOAMBuffer)
ldh [rDMA], a

; wait for DMA to finish
ld a, $28
.wait
dec a
jr nz, .wait
ret
ENDL
DMARoutineEnd:
2 changes: 0 additions & 2 deletions hram.asm
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
SECTION "HRAM", HRAM

hDMARoutine:: ds 10

; Initialized to 16.
; Decremented each input iteration if the player
; presses the reset sequence (A+B+SEL+START).
Expand Down
1 change: 1 addition & 0 deletions layout.link
Original file line number Diff line number Diff line change
Expand Up @@ -195,4 +195,5 @@ SRAM $2
SRAM $3
"Saved Boxes 2"
HRAM
"OAM DMA"
"HRAM"

0 comments on commit 204bf74

Please sign in to comment.