summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2018-06-30 15:12:34 -0400
committerRangi <remy.oukaour+rangi42@gmail.com>2018-06-30 15:12:34 -0400
commit449fe79b9323d88f7d1e1f48e266ea2f959592d9 (patch)
tree19b317f04aadbcfb9afaa474fef7902fdbb4a1e7
parent193106a8fd53370ae9e2b3aca13b0d9625281627 (diff)
Use new labels
-rw-r--r--Increase-Pokémon-sprite-animation-size.md65
1 files changed, 51 insertions, 14 deletions
diff --git a/Increase-Pokémon-sprite-animation-size.md b/Increase-Pokémon-sprite-animation-size.md
index a4b7a1f..da1e672 100644
--- a/Increase-Pokémon-sprite-animation-size.md
+++ b/Increase-Pokémon-sprite-animation-size.md
@@ -4,8 +4,9 @@ By default, Pokémon sprite animations have maximum sizes that limit how creativ
## Contents
- [1. Understanding the problem](#1-understanding-the-problem)
-- [2. Edit engine/gfx/load_pics.asm](#2-edit-enginegfxload_picsasm)
-- [3. Edit engine/gfx/pic_animation.asm](#3-edit-enginegfxpic_animationasm)
+- [2. Edit wram.asm and sram.asm](#2-edit-wramasm-and-sramasm)
+- [3. Edit engine/gfx/load_pics.asm](#3-edit-enginegfxload_picsasm)
+- [4. Edit engine/gfx/pic_animation.asm](#4-edit-enginegfxpic_animationasm)
## 1. Understanding the problem
@@ -47,7 +48,43 @@ The top-left segment of VRAM (video memory) stores tiles for move animations. Th
By studying how the animation graphics are loaded and played, we can use the entire bottom-left and middle-left segments to allow 255-tile animations.
-## 2. Edit engine/gfx/load_pics.asm
+## 2. Edit wram.asm and sram.asm
+
+Edit [wram.asm](../blob/master/wram.asm):
+
+```diff
+ SECTION "Scratch RAM", WRAMX
+
+ UNION ; d000
+ wScratchTileMap:: ds BG_MAP_WIDTH * BG_MAP_HEIGHT
+ wScratchAttrMap:: ds BG_MAP_WIDTH * BG_MAP_HEIGHT
+
+ NEXTU ; d000
+-wDecompressScratch:: ds $80 tiles
+-wDecompressEnemyFrontpic:: ds $80 tiles
++wDecompressScratch:: ds $160 tiles
+ ENDU ; e000
+```
+
+Edit [sram.asm](../blob/master/sram.asm):
+
+```diff
+ SECTION "Scratch", SRAM
+
++UNION ; a000
+ sScratch:: ds $600 ; a000
++
++NEXTU ; a000
++sEnemyFrontpicSize: db
++ ds $f
++sDecompressEnemyFrontpic: ds $100
++ENDU ; a600
+```
+
+TODO: Explain changes.
+
+
+## 3. Edit engine/gfx/load_pics.asm
Most of the code and idea was taken from Pokémon Prism.
@@ -90,7 +127,7 @@ Most of the code and idea was taken from Pokémon Prism.
```diff
_GetFrontpic:
-+ ld a, BANK(sScratch)
++ ld a, BANK(sEnemyFrontpicSize)
+ call GetSRAMBank
push de
call GetBaseData
@@ -111,17 +148,17 @@ Most of the code and idea was taken from Pokémon Prism.
+ ld a, d
+ and $f0
+ or e
-+ ld [sScratch], a
++ ld [sEnemyFrontpicSize], a
pop bc
- ld hl, wDecompressScratch
- ld de, wDecompressEnemyFrontpic
-+ ld hl, sScratch + $10
++ ld hl, sDecompressEnemyFrontpic
+ ld de, wDecompressScratch
call PadFrontpic
pop hl
push hl
- ld de, wDecompressScratch
-+ ld de, sScratch + $10
++ ld de, sDecompressEnemyFrontpic
ld c, 7 * 7
ld a, [hROMBank]
ld b, a
@@ -136,7 +173,7 @@ Most of the code and idea was taken from Pokémon Prism.
- ld [rVBK], a
push hl
- ld de, wDecompressScratch
-+ ld de, sScratch + $10
++ ld de, sDecompressEnemyFrontpic
ld c, 7 * 7
ld a, [hROMBank]
ld b, a
@@ -165,7 +202,7 @@ Most of the code and idea was taken from Pokémon Prism.
ld c, 7 * 7
.got_dims
+ ; Get animation size (total - base sprite size)
-+ ld a, [sScratch]
++ ld a, [sEnemyFrontpicSize]
+ sub c
+ ret z ; Return if there's no animation
+ ld c, a
@@ -183,7 +220,7 @@ Most of the code and idea was taken from Pokémon Prism.
+ jr c, .finish
+ ; Otherwise, load the first part...
+ inc a
-+ ld [sScratch], a
++ ld [sEnemyFrontpicSize], a
+ ld c, 127 - 7 * 7
call Get2bpp
- xor a
@@ -194,7 +231,7 @@ Most of the code and idea was taken from Pokémon Prism.
+ ld hl, vTiles4
+ ld a, [hROMBank]
+ ld b, a
-+ ld a, [sScratch]
++ ld a, [sEnemyFrontpicSize]
+ ld c, a
+.finish
+ jp Get2bpp
@@ -229,10 +266,10 @@ Most of the code and idea was taken from Pokémon Prism.
ret
```
-TODO: explain changes.
+TODO: Explain changes.
-## 3. Edit engine/gfx/pic_animation.asm
+## 4. Edit engine/gfx/pic_animation.asm
```diff
PokeAnim_ConvertAndApplyBitmask:
@@ -254,7 +291,7 @@ TODO: explain changes.
ret
```
-TODO: explain changes.
+TODO: Explain changes.
Now we're done!