mirror of
https://github.com/pret/pokegold-spaceworld.git
synced 2026-09-12 10:57:25 -05:00
Addresses of sections will now be added to the linkerscript via `org`, and the section name will be the path/to/file. If there is more than one section in the file, then add a @SectionName after the path/to/file to describe the section.
82 lines
1.0 KiB
NASM
82 lines
1.0 KiB
NASM
include "constants.asm"
|
|
|
|
; if DEBUG
|
|
SECTION "home/mon_stats.asm", ROM0
|
|
; else
|
|
; SECTION "Mon Stats", ROM0 [$390f]
|
|
; endc
|
|
|
|
DrawBattleHPBar::
|
|
push hl
|
|
push de
|
|
push bc
|
|
ld a, $60
|
|
ld [hli], a
|
|
ld a, $61
|
|
ld [hli], a
|
|
push hl
|
|
ld a, $62
|
|
.asm_3957: ; 00:3957
|
|
ld [hli], a
|
|
dec d
|
|
jr nz, .asm_3957
|
|
ld a, $6b
|
|
add b
|
|
ld [hl], a
|
|
pop hl
|
|
ld a, e
|
|
and a
|
|
jr nz, .asm_396a
|
|
ld a, c
|
|
and a
|
|
jr z, .asm_397d
|
|
ld e, $1
|
|
.asm_396a: ; 00:396a
|
|
ld a, e
|
|
sub $8
|
|
jr c, .asm_3979
|
|
ld e, a
|
|
ld a, $6a
|
|
ld [hli], a
|
|
ld a, e
|
|
and a
|
|
jr z, .asm_397d
|
|
jr .asm_396a
|
|
|
|
.asm_3979: ; 00:3979
|
|
ld a, $62
|
|
add e
|
|
ld [hl], a
|
|
.asm_397d: ; 00:397d
|
|
pop bc
|
|
pop de
|
|
pop hl
|
|
ret
|
|
|
|
PrepMonFrontpic::
|
|
ld a, $1
|
|
ld [wSpriteFlipped], a
|
|
_PrepMonFrontpic::
|
|
ld a, [wMonDexIndex]
|
|
and a
|
|
jr z, .asm_39a8
|
|
cp 252
|
|
jr nc, .asm_39a8
|
|
push hl
|
|
ld de, vFrontPic
|
|
call LoadMonFrontSprite
|
|
pop hl
|
|
xor a
|
|
ldh [hGraphicStartTile], a
|
|
lb bc, 7, 7
|
|
predef PlaceGraphic
|
|
xor a
|
|
ld [wSpriteFlipped], a
|
|
ret
|
|
|
|
.asm_39a8: ; 00:39a8
|
|
xor a
|
|
ld [wSpriteFlipped], a
|
|
inc a
|
|
ld [wMonDexIndex], a
|
|
ret |