summaryrefslogtreecommitdiff
path: root/engine/search2.asm
diff options
context:
space:
mode:
authormid-kid <esteve.varela@gmail.com>2018-03-13 13:07:16 +0100
committermid-kid <esteve.varela@gmail.com>2018-03-13 13:21:40 +0100
commitbaa0dc5a963a79843b37888bcfe1d2dfe833ade9 (patch)
tree968c86105bd67a3121d8f3f20018bfc59191f4c9 /engine/search2.asm
parent12070ca50067d3abe36a730190f88ee43f2cace9 (diff)
Organize the engine/ directory
This is an informed attempt at reorganizing the engine/ directory by creating categorized subdirectories, in order to make it easier to navigate and find things. The directories created are as follows: * engine/game: Contains all "minigames", things like the unown puzzle and slot machine. * engine/gfx: Contains all handling of graphics. From loading palettes to playing animations. * engine/link: Contains all multiplayer functionality. * engine/menu: Contains all generic/misc. menus and menu code. Other, more specialized menus are in their own subdirectories (pokedex, pokegear, party menu, etc). * engine/overworld: Contains all handling of the overworld. From loading and connecting maps to wild encounters and the scripting engine. * engine/pokegear: In the same vein as engine/pokedex, except it could use some more splitting up. * engine/pokemon: Contains everything related to manipulating pokemon data. From the pokemon storage system to evolution and mail. * engine/printer: Contains everything related to printing things as well as the printer communication. * engine/title: Contains intro sequences, title screens and credits.
Diffstat (limited to 'engine/search2.asm')
-rwxr-xr-xengine/search2.asm134
1 files changed, 0 insertions, 134 deletions
diff --git a/engine/search2.asm b/engine/search2.asm
deleted file mode 100755
index b7112f1f8..000000000
--- a/engine/search2.asm
+++ /dev/null
@@ -1,134 +0,0 @@
-_FindPartyMonAboveLevel: ; 4dbd2
- ld hl, wPartyMon1Level
- call FindAboveLevel
- ret
-
-_FindPartyMonAtLeastThatHappy: ; 4dbd9
- ld hl, wPartyMon1Happiness
- call FindAtLeastThatHappy
- ret
-
-_FindPartyMonThatSpecies: ; 4dbe0
- ld hl, wPartyMon1Species
- jp FindThatSpecies
-
-_FindPartyMonThatSpeciesYourTrainerID: ; 4dbe6
- ld hl, wPartyMon1Species
- call FindThatSpecies
- ret z
- ld a, c
- ld hl, wPartyMon1ID
- ld bc, PARTYMON_STRUCT_LENGTH
- call AddNTimes
- ld a, [wPlayerID]
- cp [hl]
- jr nz, .nope
- inc hl
- ld a, [wPlayerID + 1]
- cp [hl]
- jr nz, .nope
- ld a, $1
- and a
- ret
-
-.nope
- xor a
- ret
-
-FindAtLeastThatHappy: ; 4dc0a
-; Sets the bits for the Pokemon that have a happiness greater than or equal to b.
-; The lowest bits are used. Sets z if no Pokemon in your party is at least that happy.
- ld c, $0
- ld a, [wPartyCount]
- ld d, a
-.loop
- ld a, d
- dec a
- push hl
- push bc
- ld bc, PARTYMON_STRUCT_LENGTH
- call AddNTimes
- pop bc
- ld a, b
- cp [hl]
- pop hl
- jr z, .greater_equal
- jr nc, .lower
-
-.greater_equal
- ld a, c
- or $1
- ld c, a
-
-.lower
- sla c
- dec d
- jr nz, .loop
- call RetroactivelyIgnoreEggs
- ld a, c
- and a
- ret
-
-FindAboveLevel: ; 4dc31
- ld c, $0
- ld a, [wPartyCount]
- ld d, a
-.loop
- ld a, d
- dec a
- push hl
- push bc
- ld bc, PARTYMON_STRUCT_LENGTH
- call AddNTimes
- pop bc
- ld a, b
- cp [hl]
- pop hl
- jr c, .greater
- ld a, c
- or $1
- ld c, a
-
-.greater
- sla c
- dec d
- jr nz, .loop
- call RetroactivelyIgnoreEggs
- ld a, c
- and a
- ret
-
-FindThatSpecies: ; 4dc56
-; Find species b in your party.
-; If you have no Pokemon, returns c = -1 and z.
-; If that species is in your party, returns its location in c, and nz.
-; Otherwise, returns z.
- ld c, -1
- ld hl, wPartySpecies
-.loop
- ld a, [hli]
- cp -1
- ret z
- inc c
- cp b
- jr nz, .loop
- ld a, $1
- and a
- ret
-
-RetroactivelyIgnoreEggs: ; 4dc67
- ld e, -2
- ld hl, wPartySpecies
-.loop
- ld a, [hli]
- cp -1
- ret z
- cp EGG
- jr nz, .skip_notegg
- ld a, c
- and e
- ld c, a
-
-.skip_notegg
- rlc e
- jr .loop