diff options
Diffstat (limited to 'engine')
-rw-r--r-- | engine/gfx/load_pics.asm | 45 | ||||
-rwxr-xr-x | engine/items/item_effects.asm | 18 | ||||
-rwxr-xr-x | engine/pokemon/health.asm | 4 | ||||
-rw-r--r-- | engine/pokemon/mon_menu.asm | 4 | ||||
-rwxr-xr-x | engine/pokemon/move_mon.asm | 24 |
5 files changed, 47 insertions, 48 deletions
diff --git a/engine/gfx/load_pics.asm b/engine/gfx/load_pics.asm index 18f76ec0..187350e7 100644 --- a/engine/gfx/load_pics.asm +++ b/engine/gfx/load_pics.asm @@ -43,23 +43,23 @@ GetUnownLetter: call Divide ; Increment to get 1-26 - ldh a, [hQuotient + 2] + ldh a, [hQuotient + 3] inc a ld [wUnownLetter], a ret GetMonFrontpic: - call _GetFrontpic + call GetFrontpic jp Load2bppToSRAM UnusedFrontpicPredef: - call _GetFrontpic + call GetFrontpic push hl farcall StubbedGetFrontpic pop hl jp Load2bppToSRAM -_GetFrontpic: +GetFrontpic: ld a, [wCurPartySpecies] ld [wCurSpecies], a and a @@ -69,7 +69,7 @@ _GetFrontpic: cp EGG + 1 ret nc -.is_a_pokemon: +.is_a_pokemon push de call GetBaseData ld a, [wBasePicSize] @@ -78,24 +78,22 @@ _GetFrontpic: push bc ld a, BANK(sDecompressBuffer) call OpenSRAM - ld hl, PokemonPicPointers + ld hl, PokemonPicPointers ; UnownPicPointers ld a, [wCurPartySpecies] ld d, BANK(PokemonPicPointers) cp UNOWN jr z, .unown - cp EGG jr nz, .not_egg - ld hl, EggPic ld a, BANK(EggPic) jr .ok -.unown: +.unown ld a, [wUnownLetter] ld d, BANK(UnownPicPointers) -.not_egg: +.not_egg dec a ld bc, 6 call AddNTimes @@ -108,7 +106,7 @@ _GetFrontpic: call GetFarHalfword pop af -.ok: +.ok ld de, sDecompressBuffer call FarDecompress pop bc @@ -135,11 +133,13 @@ GetMonBackpic: cp EGG + 1 ret nc -.is_a_pokemon: +.is_a_pokemon push de ld a, BANK(sDecompressBuffer) call OpenSRAM - ld hl, PokemonPicPointers + + ; These are assumed to be at the same address in their respective banks. + ld hl, PokemonPicPointers ; UnownPicPointers ld a, [wCurPartySpecies] ld d, BANK(PokemonPicPointers) cp UNOWN @@ -147,7 +147,7 @@ GetMonBackpic: ld a, [wUnownLetter] ld d, BANK(UnownPicPointers) -.ok: +.ok dec a ld bc, 6 call AddNTimes @@ -195,20 +195,17 @@ FixPicBank: push bc ld b, a ld hl, .FixPicBankTable - -.loop: +.loop ld a, [hli] cp -1 jr z, .done - inc hl cp b jr nz, .loop - dec hl ld b, [hl] -.done: +.done ld a, b pop bc pop hl @@ -223,7 +220,7 @@ FixPicBank: Function150ff: ld a, c push de - ld hl, PokemonPicPointers ; UnownPicPointers + ld hl, PokemonPicPointers dec a ld bc, 6 call AddNTimes @@ -389,7 +386,7 @@ PadFrontpic: rept 4 srl c endr -.loop: +.loop rept 16 ld [hli], a endr @@ -404,7 +401,7 @@ LoadOrientedFrontpic: rept 4 srl c endr -.left_loop: +.left_loop rept 16 ld a, [de] inc de @@ -414,9 +411,9 @@ endr jr nz, .left_loop ret -.x_flip: +.x_flip push bc -.right_loop: +.right_loop ld a, [de] inc de ld b, a diff --git a/engine/items/item_effects.asm b/engine/items/item_effects.asm index 274b8468..42e93894 100755 --- a/engine/items/item_effects.asm +++ b/engine/items/item_effects.asm @@ -261,7 +261,7 @@ UltraBall: ; e926 ld a, b jp z, .skip_hp_calc ld a, b - ldh [hPrintNum4], a + ldh [hMultiplicand + 2], a ld hl, wEnemyMonHP ld b, [hl] inc hl @@ -319,7 +319,7 @@ UltraBall: ; e926 ld b, $4 call Divide - ldh a, [hQuotient + 2] + ldh a, [hQuotient + 3] and a jr nz, .statuscheck ld a, 1 @@ -1166,12 +1166,14 @@ RareCandy: ; ef68 (3:6f68) pop de ld a, $8 call GetPartyParamLocation - ldh a, [hQuotient] + + ldh a, [hMultiplicand + 0] ld [hli], a - ldh a, [hPrintNum3] + ldh a, [hMultiplicand + 1] ld [hli], a - ldh a, [hPrintNum4] + ldh a, [hMultiplicand + 2] ld [hl], a + ld a, $24 call GetPartyParamLocation ld a, [hli] @@ -1813,9 +1815,9 @@ GetOneFifthMaxHP: ; f3ce (3:73ce) ldh [hDivisor], a ld b, 2 call Divide - ldh a, [hQuotient + 1] - ld d, a ldh a, [hQuotient + 2] + ld d, a + ldh a, [hQuotient + 3] ld e, a pop bc ret @@ -2704,7 +2706,7 @@ Functionf8c8: ; f8c8 (3:78c8) and a jr z, .asm_f8fd .asm_f8ea - ldh a, [hPrintNum4] + ldh a, [hQuotient + 3] cp $8 jr c, .asm_f8f2 ld a, $7 diff --git a/engine/pokemon/health.asm b/engine/pokemon/health.asm index a94a3ec3..8bf0752a 100755 --- a/engine/pokemon/health.asm +++ b/engine/pokemon/health.asm @@ -80,10 +80,10 @@ ComputeHPBarPixels: ldh [hDividend + 2], a .asm_c711 ld a, e - ldh [hPrintNum5], a + ldh [hDivisor], a ld b, $4 call Divide - ldh a, [hPrintNum4] + ldh a, [hQuotient + 3] ld e, a pop hl and a diff --git a/engine/pokemon/mon_menu.asm b/engine/pokemon/mon_menu.asm index 6cc65879..aa211ae1 100644 --- a/engine/pokemon/mon_menu.asm +++ b/engine/pokemon/mon_menu.asm @@ -754,10 +754,10 @@ MonMenu_Softboiled_MilkDrink: call Divide ld a, MON_HP + 1 call GetPartyParamLocation - ldh a, [hQuotient + 2] + ldh a, [hQuotient + 3] sub [hl] dec hl - ldh a, [hQuotient + 1] + ldh a, [hQuotient + 2] sbc [hl] ret diff --git a/engine/pokemon/move_mon.asm b/engine/pokemon/move_mon.asm index 5fce891f..f6ef241e 100755 --- a/engine/pokemon/move_mon.asm +++ b/engine/pokemon/move_mon.asm @@ -793,11 +793,11 @@ Functiondd6a: ; dd6a (3:5d6a) pop bc ld hl, $8 add hl, bc - ldh a, [hQuotient] + ldh a, [hMultiplicand] ld [hli], a - ldh a, [hPrintNum3] + ldh a, [hMultiplicand + 1] ld [hli], a - ldh a, [hPrintNum4] + ldh a, [hMultiplicand + 2] ld [hl], a and a ret @@ -892,13 +892,13 @@ SendMonIntoBox: ; de74 (3:5e74) ld d, a callfar CalcExpAtLevel pop de - ldh a, [hQuotient] + ldh a, [hProduct + 1] ld [de], a inc de - ldh a, [hPrintNum3] + ldh a, [hProduct + 2] ld [de], a inc de - ldh a, [hPrintNum4] + ldh a, [hProduct + 3] ld [de], a inc de xor a @@ -1439,11 +1439,11 @@ CalcMonStatC: ; e181 jr nz, .not_hp ld a, [wCurPartyLevel] ld b, a - ldh a, [hQuotient + 2] + ldh a, [hQuotient + 3] add b ldh [hMultiplicand + 2], a jr nc, .no_overflow_3 - ldh a, [hQuotient + 1] + ldh a, [hQuotient + 2] inc a ldh [hMultiplicand + 1], a @@ -1452,21 +1452,21 @@ CalcMonStatC: ; e181 .not_hp ld b, a - ldh a, [hQuotient + 2] + ldh a, [hQuotient + 3] add b ldh [hMultiplicand + 2], a jr nc, .no_overflow_4 - ldh a, [hQuotient + 1] + ldh a, [hQuotient + 2] inc a ldh [hMultiplicand + 1], a .no_overflow_4 - ldh a, [hQuotient + 1] + ldh a, [hQuotient + 2] cp (1000 / $100) + 1 jr nc, .max_stat cp 1000 / $100 jr c, .stat_value_okay - ldh a, [hQuotient + 2] + ldh a, [hQuotient + 3] cp 1000 % $100 jr c, .stat_value_okay |