summaryrefslogtreecommitdiff
path: root/engine/pokemon/types.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/pokemon/types.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/pokemon/types.asm')
-rw-r--r--engine/pokemon/types.asm99
1 files changed, 99 insertions, 0 deletions
diff --git a/engine/pokemon/types.asm b/engine/pokemon/types.asm
new file mode 100644
index 000000000..dc0df61ae
--- /dev/null
+++ b/engine/pokemon/types.asm
@@ -0,0 +1,99 @@
+PrintMonTypes: ; 5090d
+; Print one or both types of [wCurSpecies]
+; on the stats screen at hl.
+
+ push hl
+ call GetBaseData
+ pop hl
+
+ push hl
+ ld a, [wBaseType1]
+ call .Print
+
+ ; Single-typed monsters really
+ ; have two of the same type.
+ ld a, [wBaseType1]
+ ld b, a
+ ld a, [wBaseType2]
+ cp b
+ pop hl
+ jr z, .hide_type_2
+
+ ld bc, SCREEN_WIDTH
+ add hl, bc
+
+.Print:
+ ld b, a
+ jr PrintType
+
+.hide_type_2
+ ; Erase any type name that was here before.
+ ; Seems to be pointless in localized versions.
+ ld a, " "
+ ld bc, SCREEN_WIDTH - 3
+ add hl, bc
+ ld [hl], a
+ inc bc
+ add hl, bc
+ ld bc, NAME_LENGTH_JAPANESE - 1
+ jp ByteFill
+; 5093a
+
+
+PrintMoveType: ; 5093a
+; Print the type of move b at hl.
+
+ push hl
+ ld a, b
+ dec a
+ ld bc, MOVE_LENGTH
+ ld hl, Moves
+ call AddNTimes
+ ld de, wStringBuffer1
+ ld a, BANK(Moves)
+ call FarCopyBytes
+ ld a, [wStringBuffer1 + MOVE_TYPE]
+ pop hl
+
+ ld b, a
+
+
+PrintType: ; 50953
+; Print type b at hl.
+
+ ld a, b
+
+ push hl
+ add a
+ ld hl, TypeNames
+ ld e, a
+ ld d, 0
+ add hl, de
+ ld a, [hli]
+ ld e, a
+ ld d, [hl]
+ pop hl
+
+ jp PlaceString
+; 50964
+
+
+GetTypeName: ; 50964
+; Copy the name of type [wd265] to wStringBuffer1.
+
+ ld a, [wd265]
+ ld hl, TypeNames
+ ld e, a
+ ld d, 0
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ ld de, wStringBuffer1
+ ld bc, MOVE_NAME_LENGTH
+ jp CopyBytes
+; 5097b
+
+
+INCLUDE "data/types/names.asm"