mirror of
https://github.com/pret/pokegold-spaceworld.git
synced 2026-03-22 10:04:52 -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.
55 lines
479 B
NASM
Executable File
55 lines
479 B
NASM
Executable File
INCLUDE "constants.asm"
|
|
|
|
SECTION "engine/bcd.asm", ROMX
|
|
|
|
AddBCD: ; 03:4de3
|
|
and a
|
|
ld b, c
|
|
.add
|
|
ld a, [de]
|
|
adc [hl]
|
|
daa
|
|
ld [de], a
|
|
dec de
|
|
dec hl
|
|
dec c
|
|
jr nz, .add
|
|
jr nc, .done
|
|
|
|
ld a, $99
|
|
inc de
|
|
|
|
.fill
|
|
ld [de], a
|
|
inc de
|
|
dec b
|
|
jr nz, .fill
|
|
|
|
.done
|
|
ret
|
|
|
|
|
|
SubBCD: ; 03:4df9
|
|
and a
|
|
ld b, c
|
|
.sub
|
|
ld a, [de]
|
|
sbc [hl]
|
|
daa
|
|
ld [de], a
|
|
dec de
|
|
dec hl
|
|
dec c
|
|
jr nz, .sub
|
|
jr nc, .done
|
|
ld a, 0
|
|
inc de
|
|
|
|
.fill
|
|
ld [de], a
|
|
inc de
|
|
dec b
|
|
jr nz, .fill
|
|
scf
|
|
.done
|
|
ret |