summaryrefslogtreecommitdiff
path: root/engine/routines
diff options
context:
space:
mode:
Diffstat (limited to 'engine/routines')
-rw-r--r--engine/routines/drawkrispackgfx.asm8
-rw-r--r--engine/routines/loadpushoam.asm2
-rw-r--r--engine/routines/printitemdescription.asm31
-rwxr-xr-xengine/routines/sine.asm4
-rw-r--r--engine/routines/switchpartymons.asm10
5 files changed, 42 insertions, 13 deletions
diff --git a/engine/routines/drawkrispackgfx.asm b/engine/routines/drawkrispackgfx.asm
index 457dd7110..54a21e447 100644
--- a/engine/routines/drawkrispackgfx.asm
+++ b/engine/routines/drawkrispackgfx.asm
@@ -11,10 +11,10 @@ DrawKrisPackGFX: ; 48e81
ret
PackFGFXPointers: ; 48e93
- dw PackFGFX + (15 tiles) * 1
- dw PackFGFX + (15 tiles) * 3
- dw PackFGFX + (15 tiles) * 0
- dw PackFGFX + (15 tiles) * 2
+ dw PackFGFX + (15 tiles) * 1 ; ITEM_POCKET
+ dw PackFGFX + (15 tiles) * 3 ; BALL_POCKET
+ dw PackFGFX + (15 tiles) * 0 ; KEY_ITEM_POCKET
+ dw PackFGFX + (15 tiles) * 2 ; TM_HM_POCKET
PackFGFX: ; 48e9b
INCBIN "gfx/pack/pack_f.2bpp"
diff --git a/engine/routines/loadpushoam.asm b/engine/routines/loadpushoam.asm
index 6af0ddf6d..c07c06d0f 100644
--- a/engine/routines/loadpushoam.asm
+++ b/engine/routines/loadpushoam.asm
@@ -13,7 +13,7 @@ LoadPushOAM:: ; 4031
.PushOAM: ; 403f
ld a, HIGH(Sprites)
ld [rDMA], a
- ld a, (SpritesEnd - Sprites) / 4 ; 40
+ ld a, NUM_SPRITE_OAM_STRUCTS
.pushoam_loop
dec a
jr nz, .pushoam_loop
diff --git a/engine/routines/printitemdescription.asm b/engine/routines/printitemdescription.asm
new file mode 100644
index 000000000..4da061fda
--- /dev/null
+++ b/engine/routines/printitemdescription.asm
@@ -0,0 +1,31 @@
+PrintItemDescription: ; 0x1c8955
+; Print the description for item [CurSpecies] at de.
+
+ ld a, [CurSpecies]
+ cp TM01
+ jr c, .not_a_tm
+
+ ld [CurItem], a
+ push de
+ farcall GetTMHMItemMove
+ pop hl
+ ld a, [wd265]
+ ld [CurSpecies], a
+ predef Predef_PrintMoveDesc
+ ret
+
+.not_a_tm
+ push de
+ ld hl, ItemDescriptions
+ ld a, [CurSpecies]
+ dec a
+ ld c, a
+ ld b, 0
+ add hl, bc
+ add hl, bc
+ ld e, [hl]
+ inc hl
+ ld d, [hl]
+ pop hl
+ jp PlaceString
+; 0x1c8987
diff --git a/engine/routines/sine.asm b/engine/routines/sine.asm
index 89a905d2e..5f56a10a8 100755
--- a/engine/routines/sine.asm
+++ b/engine/routines/sine.asm
@@ -7,7 +7,6 @@ _Sine:: ; 84d9
and %111111
cp %100000
jr nc, .negative
-
call .ApplySineWave
ld a, h
ret
@@ -16,7 +15,7 @@ _Sine:: ; 84d9
and %011111
call .ApplySineWave
ld a, h
- xor -1
+ xor $ff
inc a
ret
@@ -31,7 +30,6 @@ _Sine:: ; 84d9
inc hl
ld d, [hl]
ld hl, 0
-
; Factor amplitude
.multiply
srl a
diff --git a/engine/routines/switchpartymons.asm b/engine/routines/switchpartymons.asm
index cde9c82b2..1379dff9c 100644
--- a/engine/routines/switchpartymons.asm
+++ b/engine/routines/switchpartymons.asm
@@ -25,13 +25,13 @@ _SwitchPartyMons:
ld a, " "
call ByteFill
pop af
- ld hl, Sprites
- ld bc, $10
+ ld hl, Sprite01
+ ld bc, 4 * SPRITEOAMSTRUCT_LENGTH
call AddNTimes
- ld de, $4
- ld c, $4
+ ld de, SPRITEOAMSTRUCT_LENGTH
+ ld c, 4
.gfx_loop
- ld [hl], $a0
+ ld [hl], SCREEN_WIDTH_PX ; y (off-screen)
add hl, de
dec c
jr nz, .gfx_loop