mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2024-11-16 11:27:33 -08:00
7d4486e6a3
engine/routines/ stores isolated out-of-context routines as individual files. It might be preferable later to append them to their related engine/ files in unique little SECTIONs, relying on the linkerscript to place them appropriately; or some other organization method. In the meantime, they're now easily findable apart from main.asm's other content.
65 lines
807 B
NASM
65 lines
807 B
NASM
Function1dd6a9: ; 1dd6a9
|
|
; XXX
|
|
ld a, b
|
|
ld b, c
|
|
ld c, a
|
|
push bc
|
|
push de
|
|
ld hl, sp+$2
|
|
ld d, h
|
|
ld e, l
|
|
pop hl
|
|
lb bc, PRINTNUM_LEADINGZEROS | 2, 5
|
|
call PrintNum
|
|
pop bc
|
|
ret
|
|
|
|
PrintHoursMins: ; 1dd6bb (77:56bb)
|
|
; Hours in b, minutes in c
|
|
ld a, b
|
|
cp 12
|
|
push af
|
|
jr c, .AM
|
|
jr z, .PM
|
|
sub 12
|
|
jr .PM
|
|
.AM:
|
|
or a
|
|
jr nz, .PM
|
|
ld a, 12
|
|
.PM:
|
|
ld b, a
|
|
; Crazy stuff happening with the stack
|
|
push bc
|
|
ld hl, sp+$1
|
|
push de
|
|
push hl
|
|
pop de
|
|
pop hl
|
|
ld [hl], " "
|
|
lb bc, 1, 2
|
|
call PrintNum
|
|
ld [hl], ":"
|
|
inc hl
|
|
ld d, h
|
|
ld e, l
|
|
ld hl, sp+$0
|
|
push de
|
|
push hl
|
|
pop de
|
|
pop hl
|
|
lb bc, PRINTNUM_LEADINGZEROS | 1, 2
|
|
call PrintNum
|
|
pop bc
|
|
ld de, String_AM
|
|
pop af
|
|
jr c, .place_am_pm
|
|
ld de, String_PM
|
|
.place_am_pm
|
|
inc hl
|
|
call PlaceString
|
|
ret
|
|
|
|
String_AM: db "AM@" ; 1dd6fc
|
|
String_PM: db "PM@" ; 1dd6ff
|