diff options
Diffstat (limited to 'engine/routines')
-rw-r--r-- | engine/routines/correcterrorsinplayerparty.asm | 4 | ||||
-rw-r--r-- | engine/routines/drawkrispackgfx.asm | 8 | ||||
-rw-r--r-- | engine/routines/flagpredef.asm | 4 | ||||
-rw-r--r-- | engine/routines/loadpushoam.asm | 2 | ||||
-rw-r--r-- | engine/routines/newpokedexentry.asm | 2 | ||||
-rw-r--r-- | engine/routines/placegraphic.asm | 2 | ||||
-rw-r--r-- | engine/routines/playslowcry.asm | 2 | ||||
-rw-r--r-- | engine/routines/printhoursmins.asm | 3 | ||||
-rw-r--r-- | engine/routines/printitemdescription.asm | 31 | ||||
-rwxr-xr-x | engine/routines/sine.asm | 4 | ||||
-rw-r--r-- | engine/routines/switchpartymons.asm | 10 | ||||
-rw-r--r-- | engine/routines/trademonfrontpic.asm | 6 |
12 files changed, 53 insertions, 25 deletions
diff --git a/engine/routines/correcterrorsinplayerparty.asm b/engine/routines/correcterrorsinplayerparty.asm index 2fa98a545..fcc2f36af 100644 --- a/engine/routines/correcterrorsinplayerparty.asm +++ b/engine/routines/correcterrorsinplayerparty.asm @@ -1,4 +1,4 @@ -CorrectErrorsInPlayerParty: ; unreferenced +Unreferenced_CorrectErrorsInPlayerParty: ld hl, PartyCount ld a, [hl] and a @@ -90,7 +90,7 @@ CorrectErrorsInPlayerParty: ; unreferenced ld hl, MON_STAT_EXP - 1 add hl, bc ld b, $1 - predef CalcPkmnStats + predef Predef_CalcPkmnStats pop hl ld bc, PARTYMON_STRUCT_LENGTH add hl, bc 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/flagpredef.asm b/engine/routines/flagpredef.asm index bd4f37882..676960c31 100644 --- a/engine/routines/flagpredef.asm +++ b/engine/routines/flagpredef.asm @@ -1,5 +1,5 @@ -FlagPredef: ; 4d7c1 -; Perform action b on flag c in flag array hl. +Predef_SmallFarFlagAction: ; 4d7c1 +; Perform action b on bit c in flag array hl. ; If checking a flag, check flag array d:hl unless d is 0. ; For longer flag arrays, see FlagAction. 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/newpokedexentry.asm b/engine/routines/newpokedexentry.asm index acf9fca7b..c52188f6e 100644 --- a/engine/routines/newpokedexentry.asm +++ b/engine/routines/newpokedexentry.asm @@ -1,4 +1,4 @@ -NewPokedexEntry: ; fb877 +Predef_NewPokedexEntry: ; fb877 ld a, [hMapAnims] push af xor a diff --git a/engine/routines/placegraphic.asm b/engine/routines/placegraphic.asm index d72364776..28b69fc23 100644 --- a/engine/routines/placegraphic.asm +++ b/engine/routines/placegraphic.asm @@ -1,4 +1,4 @@ -PlaceGraphic: ; 2ef6e +Predef_PlaceGraphic: ; 2ef6e ; Fill wBoxAlignment-aligned box width b height c ; with iterating tile starting from hGraphicStartTile at hl. ; Predef $13 diff --git a/engine/routines/playslowcry.asm b/engine/routines/playslowcry.asm index 3cc347a55..636741bcf 100644 --- a/engine/routines/playslowcry.asm +++ b/engine/routines/playslowcry.asm @@ -1,4 +1,4 @@ -PlaySlowCry: ; fb841 +Special_PlaySlowCry: ; fb841 ld a, [ScriptVar] call LoadCryHeader jr c, .done diff --git a/engine/routines/printhoursmins.asm b/engine/routines/printhoursmins.asm index 50117188c..eb7dc1619 100644 --- a/engine/routines/printhoursmins.asm +++ b/engine/routines/printhoursmins.asm @@ -1,5 +1,4 @@ -Function1dd6a9: ; 1dd6a9 -; XXX +Unreferenced_Function1dd6a9: ; 1dd6a9 ld a, b ld b, c ld c, a 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 diff --git a/engine/routines/trademonfrontpic.asm b/engine/routines/trademonfrontpic.asm index e312042ff..2d05a1c04 100644 --- a/engine/routines/trademonfrontpic.asm +++ b/engine/routines/trademonfrontpic.asm @@ -4,13 +4,13 @@ GetTrademonFrontpic: ; 4d7fd ld de, vTiles2 push de push af - predef GetUnownLetter + predef Predef_GetUnownLetter pop af ld [CurPartySpecies], a ld [CurSpecies], a call GetBaseData pop de - predef GetAnimatedFrontpicPredef + predef Predef_GetAnimatedFrontpic ret AnimateTrademonFrontpic: ; 4d81e @@ -34,5 +34,5 @@ AnimateTrademonFrontpic: ; 4d81e hlcoord 7, 2 ld d, $0 ld e, ANIM_MON_TRADE - predef AnimateFrontpic + predef Predef_AnimateFrontpic ret |