diff options
-rwxr-xr-x | engine/HoF_room_pc.asm | 2 | ||||
-rwxr-xr-x | engine/battle/animations.asm | 4 | ||||
-rw-r--r-- | engine/battle/battle_transitions.asm | 68 | ||||
-rwxr-xr-x | engine/battle/core.asm | 2 | ||||
-rw-r--r-- | engine/battle/draw_hud_pokeball_gfx.asm | 2 | ||||
-rwxr-xr-x | engine/menu/start_sub_menus.asm | 6 | ||||
-rwxr-xr-x | engine/menu/status_screen.asm | 27 | ||||
-rwxr-xr-x | engine/oak_speech2.asm | 1 | ||||
-rw-r--r-- | engine/oam_dma.asm | 3 | ||||
-rwxr-xr-x | engine/overworld/cinnabar_lab.asm | 2 | ||||
-rw-r--r-- | engine/overworld/movement.asm | 4 | ||||
-rwxr-xr-x | engine/save.asm | 2 | ||||
-rwxr-xr-x | engine/titlescreen.asm | 2 | ||||
-rw-r--r-- | home.asm | 6 | ||||
-rw-r--r-- | home/overworld.asm | 2 | ||||
-rw-r--r-- | home/text.asm | 26 | ||||
-rwxr-xr-x | main.asm | 12 | ||||
-rwxr-xr-x | scripts/celadonmartroof.asm | 2 |
18 files changed, 88 insertions, 85 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 @@ -3176,7 +3176,7 @@ UncompressSpriteFromDE:: ; 36eb (0:36eb) SaveScreenTilesToBuffer2:: ; 36f4 (0:36f4) hlCoord 0, 0 ld de, wTileMapBackup2 - ld bc, $168 + ld bc, SCREEN_WIDTH * SCREEN_HEIGHT call CopyData ret @@ -3199,7 +3199,7 @@ LoadScreenTilesFromBuffer2DisableBGTransfer:: ; 3709 (0:3709) SaveScreenTilesToBuffer1:: ; 3719 (0:3719) hlCoord 0, 0 ld de, wTileMapBackup - ld bc, $168 + ld bc, SCREEN_WIDTH * SCREEN_HEIGHT jp CopyData LoadScreenTilesFromBuffer1:: ; 3725 (0:3725) @@ -3207,7 +3207,7 @@ LoadScreenTilesFromBuffer1:: ; 3725 (0:3725) ld [H_AUTOBGTRANSFERENABLED], a ld hl, wTileMapBackup deCoord 0, 0 - ld bc, $168 + ld bc, SCREEN_WIDTH * SCREEN_HEIGHT call CopyData ld a, $1 ld [H_AUTOBGTRANSFERENABLED], a diff --git a/home/overworld.asm b/home/overworld.asm index f0cde773..bb5ae234 100644 --- a/home/overworld.asm +++ b/home/overworld.asm @@ -1753,7 +1753,7 @@ ScheduleEastColumnRedraw:: ; 0ed3 (0:0ed3) ScheduleColumnRedrawHelper:: ; 0ef2 (0:0ef2) ld de,wScreenEdgeTiles - ld c,$12 + ld c,SCREEN_HEIGHT .loop ld a,[hli] ld [de],a diff --git a/home/text.asm b/home/text.asm index 172a4eb2..11303659 100644 --- a/home/text.asm +++ b/home/text.asm @@ -61,16 +61,16 @@ PlaceNextChar:: ; 1956 (0:1956) .PlaceText cp $4E jr nz,.next - ld bc,$0028 + ld bc,SCREEN_WIDTH * 2 ld a,[hFlags_0xFFF6] bit 2,a jr z,.next2 - ld bc,$14 + ld bc,SCREEN_WIDTH .next2 pop hl add hl,bc push hl - jp Next19E8 + jp PlaceNextChar_inc .next cp $4F @@ -78,7 +78,7 @@ PlaceNextChar:: ; 1956 (0:1956) pop hl hlCoord 1, 16 push hl - jp Next19E8 + jp PlaceNextChar_inc .next3 ; Check against a dictionary and a @@ -123,7 +123,7 @@ PlaceNextChar:: ; 1956 (0:1956) jp z,Char5A ld [hli],a call PrintLetterDelay -Next19E8:: ; 19e8 (0:19e8) +PlaceNextChar_inc:: ; 19e8 (0:19e8) inc de jp PlaceNextChar @@ -273,7 +273,7 @@ Char58:: ; 1a95 (0:1a95) Next1AA2:: ; 1aa2 (0:1aa2) call ProtectedDelay3 call ManualTextScroll - ld a,$7F + ld a, " " Coorda 18, 16 Char57:: ; 1aad (0:1aad) pop hl @@ -297,7 +297,7 @@ Char51:: ; 1ab4 (0:1ab4) call DelayFrames pop de hlCoord 1, 14 - jp Next19E8 + jp PlaceNextChar_inc Char49:: ; 1ad5 (0:1ad5) push de @@ -314,7 +314,7 @@ Char49:: ; 1ad5 (0:1ad5) pop hl hlCoord 1, 11 push hl - jp Next19E8 + jp PlaceNextChar_inc Char4B:: ; 1af8 (0:1af8) ld a,$EE @@ -323,7 +323,7 @@ Char4B:: ; 1af8 (0:1af8) push de call ManualTextScroll pop de - ld a,$7F + ld a, " " Coorda 18, 16 ;fall through Char4C:: ; 1b0a (0:1b0a) @@ -332,12 +332,12 @@ Char4C:: ; 1b0a (0:1b0a) call Next1B18 hlCoord 1, 16 pop de - jp Next19E8 + jp PlaceNextChar_inc Next1B18:: ; 1b18 (0:1b18) hlCoord 0, 14 deCoord 0, 13 - ld b,$3C + ld b,60 .next ld a,[hli] ld [de],a @@ -345,8 +345,8 @@ Next1B18:: ; 1b18 (0:1b18) dec b jr nz,.next hlCoord 1, 16 - ld a,$7F - ld b,$12 + ld a, " " + ld b,SCREEN_WIDTH - 2 .next2 ld [hli],a dec b @@ -1157,7 +1157,7 @@ PrintStartMenuItem: ; 71bb (1:71bb) push hl call PlaceString pop hl - ld de,$28 + ld de,SCREEN_WIDTH * 2 add hl,de ret @@ -1755,14 +1755,14 @@ DisplayFieldMoveMonMenu: ; 76e1 (1:36e1) sub e ld c, a pop af - ld de, $ffd8 + ld de, -SCREEN_WIDTH * 2 .asm_7725 add hl, de inc b inc b dec a jr nz, .asm_7725 - ld de, $ffec + ld de, -SCREEN_WIDTH add hl, de inc b call TextBoxBorder @@ -1773,7 +1773,7 @@ DisplayFieldMoveMonMenu: ; 76e1 (1:36e1) ld e, a ld d, $0 add hl, de - ld de, $ffd8 + ld de, -SCREEN_WIDTH * 2 ld a, [wTrainerScreenX] .asm_7747 add hl, de @@ -1806,7 +1806,7 @@ DisplayFieldMoveMonMenu: ; 76e1 (1:36e1) ld d, b ld e, c call PlaceString - ld bc, $28 + ld bc, SCREEN_WIDTH * 2 add hl, bc pop de jr .asm_7752 @@ -4031,7 +4031,7 @@ _MoveMon: ; f51e (3:751e) ld [hli], a ld d, h ld e, l - ld bc, $ffee + ld bc, -18 add hl, bc ld b, $1 call CalcStats diff --git a/scripts/celadonmartroof.asm b/scripts/celadonmartroof.asm index 953b1583..8b6ff60f 100755 --- a/scripts/celadonmartroof.asm +++ b/scripts/celadonmartroof.asm @@ -202,7 +202,7 @@ CeladonMartRoofScript_48532: ; 48532 (12:4532) call GetItemName hlCoord 2, 2 ld a, [$ffdb] - ld bc, $28 + ld bc, SCREEN_WIDTH * 2 call AddNTimes ld de, wcd6d call PlaceString |