diff options
author | Rangi <remy.oukaour+rangi42@gmail.com> | 2019-04-08 18:50:10 -0400 |
---|---|---|
committer | Rangi <remy.oukaour+rangi42@gmail.com> | 2019-04-08 19:42:55 -0400 |
commit | 2184b60a0cb5e3d1c2b64f7787f3fc0da5efbcab (patch) | |
tree | 473c39b05f00c29e399be8a02b028a11521df813 /engine/events | |
parent | ec8869584ff7a02ab1ca12fe8b5e6652034f2f17 (diff) |
Identify and eliminate wEngineBuffer1-5
Diffstat (limited to 'engine/events')
-rw-r--r-- | engine/events/elevator.asm | 6 | ||||
-rw-r--r-- | engine/events/misc_scripts.asm | 6 | ||||
-rw-r--r-- | engine/events/misc_scripts_2.asm | 4 | ||||
-rw-r--r-- | engine/events/mom_phone.asm | 10 | ||||
-rw-r--r-- | engine/events/overworld.asm | 2 | ||||
-rw-r--r-- | engine/events/poisonstep.asm | 24 |
6 files changed, 26 insertions, 26 deletions
diff --git a/engine/events/elevator.asm b/engine/events/elevator.asm index 1f8c902ca..71b25bef7 100644 --- a/engine/events/elevator.asm +++ b/engine/events/elevator.asm @@ -28,7 +28,7 @@ Elevator:: .LoadFloors: ld de, wCurElevator - ld bc, 4 + ld bc, wElevatorDataEnd - wElevatorData ld hl, wElevatorPointer ld a, [hli] ld h, [hl] @@ -104,12 +104,12 @@ Elevator_GoToFloor: ld l, a inc hl pop af - ld bc, 4 + ld bc, wElevatorDataEnd - wElevatorData call AddNTimes inc hl ld de, wBackupWarpNumber ld a, [wElevatorPointerBank] - ld bc, 3 + ld bc, wElevatorDataEnd - wElevatorData - 1 call FarCopyBytes ret diff --git a/engine/events/misc_scripts.asm b/engine/events/misc_scripts.asm index e2ea5439a..653a9eb35 100644 --- a/engine/events/misc_scripts.asm +++ b/engine/events/misc_scripts.asm @@ -40,14 +40,14 @@ FindItemInBallScript:: .TryReceiveItem: xor a ld [wScriptVar], a - ld a, [wEngineBuffer1] + ld a, [wItemBallItemID] ld [wNamedObjectIndexBuffer], a call GetItemName ld hl, wStringBuffer3 call CopyName2 - ld a, [wEngineBuffer1] + ld a, [wItemBallItemID] ld [wCurItem], a - ld a, [wCurFruit] + ld a, [wItemBallQuantity] ld [wItemQuantityChangeBuffer], a ld hl, wNumItems call ReceiveItem diff --git a/engine/events/misc_scripts_2.asm b/engine/events/misc_scripts_2.asm index 515d8d396..6b675bea8 100644 --- a/engine/events/misc_scripts_2.asm +++ b/engine/events/misc_scripts_2.asm @@ -12,7 +12,7 @@ RepelWoreOffScript:: HiddenItemScript:: opentext - readmem wEngineBuffer3 + readmem wHiddenItemID getitemname STRING_BUFFER_3, USE_SCRIPT_VAR writetext .found_text giveitem ITEM_FROM_MEM @@ -42,7 +42,7 @@ HiddenItemScript:: text_end SetMemEvent: - ld hl, wEngineBuffer1 + ld hl, wHiddenItemEvent ld a, [hli] ld d, [hl] ld e, a diff --git a/engine/events/mom_phone.asm b/engine/events/mom_phone.asm index 27144b339..ef3f6457b 100644 --- a/engine/events/mom_phone.asm +++ b/engine/events/mom_phone.asm @@ -39,13 +39,13 @@ MomTriesToBuySomething:: .ok ld a, PHONE_MOM ld [wCurCaller], a - ld bc, wEngineBuffer2 - ld hl, 0 + ld bc, wCallerContact + ld hl, PHONE_CONTACT_TRAINER_CLASS add hl, bc - ld [hl], 0 + ld [hl], TRAINER_NONE inc hl - ld [hl], 1 - ld hl, wPhoneScriptPointer - wEngineBuffer2 + ld [hl], PHONE_MOM + ld hl, PHONE_CONTACT_SCRIPT2_BANK add hl, bc ld a, BANK(Mom_GetScriptPointer) ld [hli], a diff --git a/engine/events/overworld.asm b/engine/events/overworld.asm index 2e98dcc6c..788b0eb92 100644 --- a/engine/events/overworld.asm +++ b/engine/events/overworld.asm @@ -500,7 +500,7 @@ TrySurfOW:: jr z, .quit ; Must be facing water. - ld a, [wEngineBuffer1] + ld a, [wFacingTileID] call GetTileCollision cp WATERTILE jr nz, .quit diff --git a/engine/events/poisonstep.asm b/engine/events/poisonstep.asm index 6d4106a43..70da92f13 100644 --- a/engine/events/poisonstep.asm +++ b/engine/events/poisonstep.asm @@ -4,29 +4,29 @@ DoPoisonStep:: jr z, .no_faint xor a - ld c, 7 - ld hl, wEngineBuffer1 -.loop_clearEngineBuffer1 + ld c, wPoisonStepDataEnd - wPoisonStepData + ld hl, wPoisonStepData +.loop_clearPoisonStepData ld [hli], a dec c - jr nz, .loop_clearEngineBuffer1 + jr nz, .loop_clearPoisonStepData xor a ld [wCurPartyMon], a .loop_check_poison call .DamageMonIfPoisoned jr nc, .not_poisoned -; the output flag is stored in c, copy it to the ([wCurPartyMon] + 2)nd EngineBuffer -; and set the corresponding flag in wEngineBuffer1 +; the output flag is stored in c, copy it to [wPoisonStepPartyFlags + [wCurPartyMon]] +; and set the corresponding flag in wPoisonStepFlagSum ld a, [wCurPartyMon] ld e, a ld d, 0 - ld hl, wEngineBuffer2 + ld hl, wPoisonStepPartyFlags add hl, de ld [hl], c - ld a, [wEngineBuffer1] + ld a, [wPoisonStepFlagSum] or c - ld [wEngineBuffer1], a + ld [wPoisonStepFlagSum], a .not_poisoned ld a, [wPartyCount] @@ -35,10 +35,10 @@ DoPoisonStep:: cp [hl] jr nz, .loop_check_poison - ld a, [wEngineBuffer1] + ld a, [wPoisonStepFlagSum] and %10 jr nz, .someone_has_fainted - ld a, [wEngineBuffer1] + ld a, [wPoisonStepFlagSum] and %01 jr z, .no_faint call .PlayPoisonSFX @@ -120,7 +120,7 @@ DoPoisonStep:: .CheckWhitedOut: xor a ld [wCurPartyMon], a - ld de, wEngineBuffer2 + ld de, wPoisonStepPartyFlags .party_loop push de ld a, [de] |