summaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authordannye <corrnondacqb@yahoo.com>2015-07-14 02:16:19 -0500
committerdannye <corrnondacqb@yahoo.com>2015-07-14 02:16:19 -0500
commitef9e59101e10aed82184bd2fd063b1109e2e4f6a (patch)
tree2fb09fd06d2b7b960a3c0fda27e3ad9229c13a8f /engine
parente25a7148d0a78549de4f33fa72d519dcaf660e97 (diff)
Use more screen dimension constants
Diffstat (limited to 'engine')
-rwxr-xr-xengine/HoF_room_pc.asm2
-rwxr-xr-xengine/battle/animations.asm4
-rw-r--r--engine/battle/battle_transitions.asm68
-rwxr-xr-xengine/battle/core.asm2
-rw-r--r--engine/battle/draw_hud_pokeball_gfx.asm2
-rwxr-xr-xengine/menu/start_sub_menus.asm6
-rwxr-xr-xengine/menu/status_screen.asm27
-rwxr-xr-xengine/oak_speech2.asm1
-rw-r--r--engine/oam_dma.asm3
-rwxr-xr-xengine/overworld/cinnabar_lab.asm2
-rw-r--r--engine/overworld/movement.asm4
-rwxr-xr-xengine/save.asm2
-rwxr-xr-xengine/titlescreen.asm2
13 files changed, 64 insertions, 61 deletions
diff --git a/engine/HoF_room_pc.asm b/engine/HoF_room_pc.asm
index a3459f9d..98c77903 100755
--- a/engine/HoF_room_pc.asm
+++ b/engine/HoF_room_pc.asm
@@ -202,7 +202,7 @@ Credits: ; 7418e (1d:418e)
add hl, bc
call PlaceString
pop hl
- ld bc, $28
+ ld bc, SCREEN_WIDTH * 2
add hl, bc
pop de
jr .asm_7419b
diff --git a/engine/battle/animations.asm b/engine/battle/animations.asm
index 6c98cc91..32f98f19 100755
--- a/engine/battle/animations.asm
+++ b/engine/battle/animations.asm
@@ -1712,9 +1712,9 @@ _AnimationSquishMonPic: ; 794d4 (1e:54d4)
call Func_79862
inc hl
.asm_794eb
- ld [hl], $7f
+ ld [hl], " "
pop hl
- ld de, $14
+ ld de, SCREEN_WIDTH
add hl, de
pop bc
dec c
diff --git a/engine/battle/battle_transitions.asm b/engine/battle/battle_transitions.asm
index 3315b36a..8613560a 100644
--- a/engine/battle/battle_transitions.asm
+++ b/engine/battle/battle_transitions.asm
@@ -233,12 +233,12 @@ BattleTransition_InwardSpiral: ; 70aaa (1c:4aaa)
ld [wWhichTrade], a
hlCoord 0, 0
ld c, $11
- ld de, $14
+ ld de, SCREEN_WIDTH
call BattleTransition_InwardSpiral_
inc c
jr .skip
.loop
- ld de, $14
+ ld de, SCREEN_WIDTH
call BattleTransition_InwardSpiral_
.skip
inc c
@@ -246,10 +246,10 @@ BattleTransition_InwardSpiral: ; 70aaa (1c:4aaa)
call BattleTransition_InwardSpiral_
dec c
dec c
- ld de, $ffec
+ ld de, -SCREEN_WIDTH
call BattleTransition_InwardSpiral_
inc c
- ld de, rIE
+ ld de, -1
call BattleTransition_InwardSpiral_
dec c
dec c
@@ -278,8 +278,8 @@ BattleTransition_InwardSpiral_: ; 70ae0 (1c:4ae0)
ret
BattleTransition_OutwardSpiral_: ; 70af9 (1c:4af9)
- ld bc, $ffec
- ld de, $14
+ ld bc, -SCREEN_WIDTH
+ ld de, SCREEN_WIDTH
ld a, [wd09b]
ld l, a
ld a, [wd09a]
@@ -366,22 +366,22 @@ BattleTransition_FlashScreenPalettes: ; 70b72 (1c:4b72)
; used for low level trainer dungeon battles
BattleTransition_Shrink: ; 70b7f (1c:4b7f)
- ld c, $9
+ ld c, SCREEN_HEIGHT / 2
.loop
push bc
xor a
ld [H_AUTOBGTRANSFERENABLED], a
hlCoord 0, 7
deCoord 0, 8
- ld bc, $ffd8
+ ld bc, -SCREEN_WIDTH * 2
call BattleTransition_CopyTiles1
hlCoord 0, 10
deCoord 0, 9
- ld bc, $28
+ ld bc, SCREEN_WIDTH * 2
call BattleTransition_CopyTiles1
hlCoord 8, 0
deCoord 9, 0
- ld bc, $fffe
+ ld bc, -2
call BattleTransition_CopyTiles2
hlCoord 11, 0
deCoord 10, 0
@@ -400,22 +400,22 @@ BattleTransition_Shrink: ; 70b7f (1c:4b7f)
; used for high level trainer dungeon battles
BattleTransition_Split: ; 70bca (1c:4bca)
- ld c, $9
+ ld c, SCREEN_HEIGHT / 2
xor a
ld [H_AUTOBGTRANSFERENABLED], a
.loop
push bc
hlCoord 0, 16
deCoord 0, 17
- ld bc, $ffd8
+ ld bc, -SCREEN_WIDTH * 2
call BattleTransition_CopyTiles1
hlCoord 0, 1
deCoord 0, 0
- ld bc, $28
+ ld bc, SCREEN_WIDTH * 2
call BattleTransition_CopyTiles1
hlCoord 18, 0
deCoord 19, 0
- ld bc, $fffe
+ ld bc, -2
call BattleTransition_CopyTiles2
hlCoord 1, 0
deCoord 0, 0
@@ -440,7 +440,7 @@ BattleTransition_CopyTiles1: ; 70c12 (1c:4c12)
push bc
push hl
push de
- ld bc, $14
+ ld bc, SCREEN_WIDTH
call CopyData
pop hl
pop de
@@ -455,7 +455,7 @@ BattleTransition_CopyTiles1: ; 70c12 (1c:4c12)
ld l, e
ld h, d
ld a, $ff
- ld c, $14
+ ld c, SCREEN_WIDTH
.loop2
ld [hli], a
dec c
@@ -467,23 +467,23 @@ BattleTransition_CopyTiles2: ; 70c3f (1c:4c3f)
ld [wWhichTrade], a
ld a, b
ld [wTrainerEngageDistance], a
- ld c, $9
+ ld c, SCREEN_HEIGHT / 2
.loop1
push bc
push hl
push de
- ld c, $12
+ ld c, SCREEN_HEIGHT
.loop2
ld a, [hl]
ld [de], a
ld a, e
- add $14
+ add SCREEN_WIDTH
jr nc, .noCarry1
inc d
.noCarry1
ld e, a
ld a, l
- add $14
+ add SCREEN_WIDTH
jr nc, .noCarry2
inc h
.noCarry2
@@ -502,8 +502,8 @@ BattleTransition_CopyTiles2: ; 70c3f (1c:4c3f)
jr nz, .loop1
ld l, e
ld h, d
- ld de, $14
- ld c, $12
+ ld de, SCREEN_WIDTH
+ ld c, SCREEN_HEIGHT
.loop3
ld [hl], $ff
add hl, de
@@ -513,7 +513,7 @@ BattleTransition_CopyTiles2: ; 70c3f (1c:4c3f)
; used for high level wild dungeon battles
BattleTransition_VerticalStripes: ; 70c7e (1c:4c7e)
- ld c, $12
+ ld c, SCREEN_HEIGHT
hlCoord 0, 0
deCoord 1, 17
xor a
@@ -528,12 +528,12 @@ BattleTransition_VerticalStripes: ; 70c7e (1c:4c7e)
call BattleTransition_VerticalStripes_
call BattleTransition_TransferDelay3
pop hl
- ld bc, $ffec
+ ld bc, -SCREEN_WIDTH
add hl, bc
ld e, l
ld d, h
pop hl
- ld bc, $14
+ ld bc, SCREEN_WIDTH
add hl, bc
pop bc
dec c
@@ -541,7 +541,7 @@ BattleTransition_VerticalStripes: ; 70c7e (1c:4c7e)
jp BattleTransition_BlackScreen
BattleTransition_VerticalStripes_: ; 70caa (1c:4caa)
- ld c, $a
+ ld c, SCREEN_WIDTH / 2
.loop
ld [hl], $ff
inc hl
@@ -552,7 +552,7 @@ BattleTransition_VerticalStripes_: ; 70caa (1c:4caa)
; used for low level wild dungeon battles
BattleTransition_HorizontalStripes: ; 70cb4 (1c:4cb4)
- ld c, $14
+ ld c, SCREEN_WIDTH
hlCoord 0, 0
deCoord 19, 1
xor a
@@ -576,8 +576,8 @@ BattleTransition_HorizontalStripes: ; 70cb4 (1c:4cb4)
jp BattleTransition_BlackScreen
BattleTransition_HorizontalStripes_: ; 70cd8 (1c:4cd8)
- ld c, $9
- ld de, $28
+ ld c, SCREEN_HEIGHT / 2
+ ld de, SCREEN_WIDTH * 2
.loop
ld [hl], $ff
add hl, de
@@ -590,10 +590,10 @@ BattleTransition_HorizontalStripes_: ; 70cd8 (1c:4cd8)
; by animating each half circle one at a time
BattleTransition_Circle: ; 70ce4 (1c:4ce4)
call BattleTransition_FlashScreen
- ld bc, $000a
+ ld bc, SCREEN_WIDTH / 2
ld hl, BattleTransition_HalfCircle1
call BattleTransition_Circle_Sub1
- ld c, $a
+ ld c, SCREEN_WIDTH / 2
ld b, $1
ld hl, BattleTransition_HalfCircle2
call BattleTransition_Circle_Sub1
@@ -633,7 +633,7 @@ BattleTransition_TransferDelay3: ; 70d19 (1c:4d19)
; by animating both half circles at the same time
BattleTransition_DoubleCircle: ; 70d24 (1c:4d24)
call BattleTransition_FlashScreen
- ld c, $a
+ ld c, SCREEN_WIDTH / 2
ld hl, BattleTransition_HalfCircle1
ld de, BattleTransition_HalfCircle2
.loop
@@ -774,9 +774,9 @@ BattleTransition_Circle_Sub3: ; 70dc5 (1c:4dc5)
pop hl
ld a, [wWhichTrade]
and a
- ld bc, $14
+ ld bc, SCREEN_WIDTH
jr z, .skip3
- ld bc, $ffec
+ ld bc, -SCREEN_WIDTH
.skip3
add hl, bc
ld a, [de]
diff --git a/engine/battle/core.asm b/engine/battle/core.asm
index 1825e61e..5ef94998 100755
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -7047,7 +7047,7 @@ CopyUncompressedPicToTilemap: ; 3f0c6 (f:70c6)
ld a, [$ffe1]
CopyUncompressedPicToHL: ; 3f0d0 (f:70d0)
ld bc, $707
- ld de, $14
+ ld de, SCREEN_WIDTH
push af
ld a, [W_SPRITEFLIPPED]
and a
diff --git a/engine/battle/draw_hud_pokeball_gfx.asm b/engine/battle/draw_hud_pokeball_gfx.asm
index ba47d8f3..06280a15 100644
--- a/engine/battle/draw_hud_pokeball_gfx.asm
+++ b/engine/battle/draw_hud_pokeball_gfx.asm
@@ -148,7 +148,7 @@ EnemyBattleHUDGraphicsTiles: ; 3a92d (e:692d)
PlaceHUDTiles: ; 3a930 (e:6930)
ld [hl], $73
- ld bc, $14
+ ld bc, SCREEN_WIDTH
add hl, bc
ld a, [wTrainerScreenY]
ld [hl], a
diff --git a/engine/menu/start_sub_menus.asm b/engine/menu/start_sub_menus.asm
index 48a85081..825360a6 100755
--- a/engine/menu/start_sub_menus.asm
+++ b/engine/menu/start_sub_menus.asm
@@ -714,10 +714,10 @@ SwitchPartyMon: ; 13613 (4:7613)
SwitchPartyMon_OAM: ; 13625 (4:7625)
push af
hlCoord 0, 0
- ld bc, $28
+ ld bc, SCREEN_WIDTH * 2
call AddNTimes
- ld c, $28
- ld a, $7f
+ ld c, SCREEN_WIDTH * 2
+ ld a, " "
.asm_13633
ld [hli], a
dec c
diff --git a/engine/menu/status_screen.asm b/engine/menu/status_screen.asm
index c9261804..7b3674e6 100755
--- a/engine/menu/status_screen.asm
+++ b/engine/menu/status_screen.asm
@@ -280,7 +280,7 @@ PrintStat
push hl
call PrintNumber
pop hl
- ld de, $0028
+ ld de, SCREEN_WIDTH * 2
add hl, de
ret
@@ -323,15 +323,15 @@ StatusScreen2: ; 12b57 (4:6b57)
sub c
ld b, a ; Number of moves ?
hlCoord 11, 10
- ld de, $0028
- ld a, $72
- call Func_12ccb ; Print "PP"
+ ld de, SCREEN_WIDTH * 2
+ ld a, $72 ; special P tile id
+ call StatusScreen_PrintPP ; Print "PP"
ld a, b
and a
jr z, .InitPP
ld c, a
ld a, "-"
- call Func_12ccb ; Fill the rest with --
+ call StatusScreen_PrintPP ; Fill the rest with --
.InitPP ; 12bbb
ld hl, wLoadedMonMoves
deCoord 14, 10
@@ -373,7 +373,7 @@ StatusScreen2: ; 12b57 (4:6b57)
ld bc, $0102
call PrintNumber
pop hl
- ld de, $0028
+ ld de, SCREEN_WIDTH * 2
add hl, de
ld d, h
ld e, l
@@ -411,9 +411,9 @@ StatusScreen2: ; 12b57 (4:6b57)
ld bc, $0307
call PrintNumber
hlCoord 9, 0
- call Func_12cc3
+ call StatusScreen_ClearName
hlCoord 9, 1
- call Func_12cc3
+ call StatusScreen_ClearName
ld a, [W_MONHDEXNUM]
ld [wd11e], a
call GetMonName
@@ -463,15 +463,16 @@ EXPPointsText: ; 12caf (4:6caf)
LevelUpText: ; 12cba (4:6cba)
db "LEVEL UP@"
-Func_12cc3: ; 12cc3 (4:6cc3)
- ld bc, $a
- ld a, $7f
+StatusScreen_ClearName: ; 12cc3 (4:6cc3)
+ ld bc, 10
+ ld a, " "
jp FillMemory
-Func_12ccb: ; 12ccb (4:6ccb)
+StatusScreen_PrintPP: ; 12ccb (4:6ccb)
+; print PP or -- c times, going down two rows each time
ld [hli], a
ld [hld], a
add hl, de
dec c
- jr nz, Func_12ccb
+ jr nz, StatusScreen_PrintPP
ret
diff --git a/engine/oak_speech2.asm b/engine/oak_speech2.asm
index dcf0b6c5..b27a6987 100755
--- a/engine/oak_speech2.asm
+++ b/engine/oak_speech2.asm
@@ -250,6 +250,7 @@ Func_6ad6: ; 6ad6 (1:6ad6)
ld de, wcd6d
ld bc, $14
jp CopyData
+
IF DEF(_RED)
DefaultNamesPlayerList: ; 6af2 (1:6af2)
db "NEW NAME@RED@ASH@JACK@"
diff --git a/engine/oam_dma.asm b/engine/oam_dma.asm
index 3de4d773..bd89677a 100644
--- a/engine/oam_dma.asm
+++ b/engine/oam_dma.asm
@@ -19,7 +19,8 @@ DMARoutine:
; wait for DMA to finish
ld a, $28
-.wait dec a
+.wait
+ dec a
jr nz, .wait
ret
DMARoutineEnd:
diff --git a/engine/overworld/cinnabar_lab.asm b/engine/overworld/cinnabar_lab.asm
index e9bde496..3d39ad6b 100755
--- a/engine/overworld/cinnabar_lab.asm
+++ b/engine/overworld/cinnabar_lab.asm
@@ -103,7 +103,7 @@ Func_610c2: ; 610c2 (18:50c2)
call GetItemName
hlCoord 2, 2
ld a, [$ffdb]
- ld bc, $28
+ ld bc, SCREEN_WIDTH * 2
call AddNTimes
ld de, wcd6d
call PlaceString
diff --git a/engine/overworld/movement.asm b/engine/overworld/movement.asm
index 9854df61..0cbb7f1c 100644
--- a/engine/overworld/movement.asm
+++ b/engine/overworld/movement.asm
@@ -690,8 +690,8 @@ getTileSpriteStandsOn: ; 5207 (1:5207)
ld a, [hl] ; c1x6: screen Y position
srl a
srl a
- srl a ; screen X tile
- add $14 ; screen X tile + 20
+ srl a ; screen X tile
+ add SCREEN_WIDTH ; screen X tile + 20
ld d, $0
ld e, a
hlCoord 0, 0
diff --git a/engine/save.asm b/engine/save.asm
index 60fc800a..4849c53e 100755
--- a/engine/save.asm
+++ b/engine/save.asm
@@ -462,7 +462,7 @@ Func_7393f: ; 7393f (1c:793f)
call Func_73a84
hlCoord 18, 1
ld de, wWhichTrade
- ld bc, $14
+ ld bc, SCREEN_WIDTH
ld a, $c
.asm_739c2
push af
diff --git a/engine/titlescreen.asm b/engine/titlescreen.asm
index 1d640909..69a3a20e 100755
--- a/engine/titlescreen.asm
+++ b/engine/titlescreen.asm
@@ -70,7 +70,7 @@ ENDC
call Func_4519
hlCoord 2, 1
ld a, $80
- ld de, $14
+ ld de, SCREEN_WIDTH
ld c, $6
.asm_434d
ld b, $10