From f52f20edb76fb40e183473ea23bf65acbe493c6c Mon Sep 17 00:00:00 2001 From: mid-kid Date: Thu, 11 Oct 2018 11:37:19 +0200 Subject: [PATCH] Rename CheckTrainerBattle Renamed to be more in line with our current coding standards. Hopefully this is slightly more readable. --- engine/overworld/events.asm | 6 +++--- home/flag.asm | 2 +- home/trainers.asm | 8 ++++---- hram.asm | 4 +--- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/engine/overworld/events.asm b/engine/overworld/events.asm index b3dfc1983..e9fcc108c 100644 --- a/engine/overworld/events.asm +++ b/engine/overworld/events.asm @@ -248,7 +248,7 @@ PlayerEvents: call Dummy_CheckScriptFlags3Bit5 ; This is a waste of time - call CheckTrainerBattle3 + call CheckTrainerBattle_GetPlayerEvent jr c, .ok call CheckTileEvent @@ -289,10 +289,10 @@ PlayerEvents: scf ret -CheckTrainerBattle3: +CheckTrainerBattle_GetPlayerEvent: nop nop - call CheckTrainerBattle2 + call CheckTrainerBattle jr nc, .nope ld a, PLAYEREVENT_SEENBYTRAINER diff --git a/home/flag.asm b/home/flag.asm index 411f04184..e481cb6f7 100644 --- a/home/flag.asm +++ b/home/flag.asm @@ -38,7 +38,7 @@ FlagAction:: ; 1 SET_FLAG set bit ; 2 CHECK_FLAG check bit ; de: bit number -; hl: index within bit table +; hl: pointer to the flag array ; get index within the byte ld a, e diff --git a/home/trainers.asm b/home/trainers.asm index ec475e218..8d13cf5b1 100644 --- a/home/trainers.asm +++ b/home/trainers.asm @@ -1,16 +1,16 @@ -CheckTrainerBattle2:: +CheckTrainerBattle:: ldh a, [hROMBank] push af call SwitchToMapScriptsBank - call CheckTrainerBattle + call _CheckTrainerBattle pop bc ld a, b rst Bankswitch ret -CheckTrainerBattle:: +_CheckTrainerBattle:: ; Check if any trainer on the map sees the player and wants to battle. ; Skip the player object. @@ -35,7 +35,7 @@ CheckTrainerBattle:: add hl, de ld a, [hl] and $f - cp $2 + cp OBJECTTYPE_TRAINER jr nz, .next ; Is visible on the map diff --git a/hram.asm b/hram.asm index 737b03de9..5ba506afa 100644 --- a/hram.asm +++ b/hram.asm @@ -126,9 +126,7 @@ hWY:: db ; ffd2 hTilesPerCycle:: db ; ffd3 hBGMapMode:: db ; ffd4 hBGMapThird:: db ; ffd5 -hBGMapAddress:: db ; ffd6 - - ds 1 +hBGMapAddress:: dw ; ffd6 hOAMUpdate:: db ; ffd8