2018-01-16 19:30:10 +00:00
|
|
|
GetUnownLetter: ; 51040
|
2018-01-23 22:39:09 +00:00
|
|
|
; Return Unown letter in wUnownLetter based on DVs at hl
|
2016-01-29 05:57:06 +00:00
|
|
|
|
|
|
|
; Take the middle 2 bits of each DV and place them in order:
|
|
|
|
; atk def spd spc
|
|
|
|
; .ww..xx. .yy..zz.
|
|
|
|
|
|
|
|
; atk
|
|
|
|
ld a, [hl]
|
|
|
|
and %01100000
|
|
|
|
sla a
|
|
|
|
ld b, a
|
|
|
|
; def
|
|
|
|
ld a, [hli]
|
|
|
|
and %00000110
|
|
|
|
swap a
|
|
|
|
srl a
|
|
|
|
or b
|
|
|
|
ld b, a
|
|
|
|
|
|
|
|
; spd
|
|
|
|
ld a, [hl]
|
|
|
|
and %01100000
|
|
|
|
swap a
|
|
|
|
sla a
|
|
|
|
or b
|
|
|
|
ld b, a
|
|
|
|
; spc
|
|
|
|
ld a, [hl]
|
|
|
|
and %00000110
|
|
|
|
srl a
|
|
|
|
or b
|
|
|
|
|
|
|
|
; Divide by 10 to get 0-25
|
|
|
|
ld [hDividend + 3], a
|
|
|
|
xor a
|
|
|
|
ld [hDividend], a
|
|
|
|
ld [hDividend + 1], a
|
|
|
|
ld [hDividend + 2], a
|
2018-01-16 19:30:10 +00:00
|
|
|
ld a, $ff / NUM_UNOWN + 1
|
2016-01-29 05:57:06 +00:00
|
|
|
ld [hDivisor], a
|
|
|
|
ld b, 4
|
|
|
|
call Divide
|
|
|
|
|
|
|
|
; Increment to get 1-26
|
|
|
|
ld a, [hQuotient + 2]
|
|
|
|
inc a
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wUnownLetter], a
|
2016-01-29 05:57:06 +00:00
|
|
|
ret
|
|
|
|
|
2018-01-16 19:30:10 +00:00
|
|
|
GetMonFrontpic: ; 51077
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wCurPartySpecies]
|
|
|
|
ld [wCurSpecies], a
|
2016-01-29 05:57:06 +00:00
|
|
|
call IsAPokemon
|
|
|
|
ret c
|
|
|
|
ld a, [rSVBK]
|
|
|
|
push af
|
|
|
|
call _GetFrontpic
|
|
|
|
pop af
|
|
|
|
ld [rSVBK], a
|
|
|
|
ret
|
|
|
|
|
2018-01-16 19:30:10 +00:00
|
|
|
GetAnimatedFrontpic: ; 5108b
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wCurPartySpecies]
|
|
|
|
ld [wCurSpecies], a
|
2016-01-29 05:57:06 +00:00
|
|
|
call IsAPokemon
|
|
|
|
ret c
|
|
|
|
ld a, [rSVBK]
|
|
|
|
push af
|
|
|
|
xor a
|
|
|
|
ld [hBGMapMode], a
|
|
|
|
call _GetFrontpic
|
2018-01-16 19:30:10 +00:00
|
|
|
call GetAnimatedEnemyFrontpic
|
2016-01-29 05:57:06 +00:00
|
|
|
pop af
|
|
|
|
ld [rSVBK], a
|
|
|
|
ret
|
|
|
|
|
|
|
|
_GetFrontpic: ; 510a5
|
|
|
|
push de
|
|
|
|
call GetBaseData
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wBasePicSize]
|
2016-01-29 05:57:06 +00:00
|
|
|
and $f
|
|
|
|
ld b, a
|
|
|
|
push bc
|
|
|
|
call GetFrontpicPointer
|
2017-12-09 19:22:58 +00:00
|
|
|
ld a, BANK(wDecompressEnemyFrontpic)
|
2016-01-29 05:57:06 +00:00
|
|
|
ld [rSVBK], a
|
|
|
|
ld a, b
|
2017-12-09 19:22:58 +00:00
|
|
|
ld de, wDecompressEnemyFrontpic
|
2016-01-29 05:57:06 +00:00
|
|
|
call FarDecompress
|
|
|
|
pop bc
|
|
|
|
ld hl, wDecompressScratch
|
2017-12-09 19:22:58 +00:00
|
|
|
ld de, wDecompressEnemyFrontpic
|
2017-11-03 00:09:27 +00:00
|
|
|
call PadFrontpic
|
2016-01-29 05:57:06 +00:00
|
|
|
pop hl
|
|
|
|
push hl
|
|
|
|
ld de, wDecompressScratch
|
|
|
|
ld c, 7 * 7
|
|
|
|
ld a, [hROMBank]
|
|
|
|
ld b, a
|
|
|
|
call Get2bpp
|
|
|
|
pop hl
|
|
|
|
ret
|
|
|
|
|
|
|
|
GetFrontpicPointer: ; 510d7
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wCurPartySpecies]
|
2016-01-29 05:57:06 +00:00
|
|
|
cp UNOWN
|
|
|
|
jr z, .unown
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wCurPartySpecies]
|
2017-12-27 06:29:15 +00:00
|
|
|
ld d, BANK(PokemonPicPointers)
|
2016-01-29 05:57:06 +00:00
|
|
|
jr .ok
|
|
|
|
|
|
|
|
.unown
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wUnownLetter]
|
2016-01-29 05:57:06 +00:00
|
|
|
ld d, BANK(UnownPicPointers)
|
|
|
|
|
|
|
|
.ok
|
2017-12-27 06:29:15 +00:00
|
|
|
ld hl, PokemonPicPointers ; UnownPicPointers
|
2016-01-29 05:57:06 +00:00
|
|
|
dec a
|
|
|
|
ld bc, 6
|
|
|
|
call AddNTimes
|
|
|
|
ld a, d
|
|
|
|
call GetFarByte
|
|
|
|
call FixPicBank
|
|
|
|
push af
|
|
|
|
inc hl
|
|
|
|
ld a, d
|
|
|
|
call GetFarHalfword
|
|
|
|
pop bc
|
|
|
|
ret
|
|
|
|
|
2018-01-16 19:30:10 +00:00
|
|
|
GetAnimatedEnemyFrontpic: ; 51103
|
2017-12-28 12:32:33 +00:00
|
|
|
ld a, BANK(vTiles3)
|
2016-01-29 05:57:06 +00:00
|
|
|
ld [rVBK], a
|
|
|
|
push hl
|
|
|
|
ld de, wDecompressScratch
|
|
|
|
ld c, 7 * 7
|
|
|
|
ld a, [hROMBank]
|
|
|
|
ld b, a
|
|
|
|
call Get2bpp
|
|
|
|
pop hl
|
|
|
|
ld de, 7 * 7 tiles
|
|
|
|
add hl, de
|
|
|
|
push hl
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, BANK(wBasePicSize)
|
|
|
|
ld hl, wBasePicSize
|
2016-01-29 05:57:06 +00:00
|
|
|
call GetFarWRAMByte
|
|
|
|
pop hl
|
|
|
|
and $f
|
2017-12-09 19:22:58 +00:00
|
|
|
ld de, wDecompressEnemyFrontpic + 5 * 5 tiles
|
2016-01-29 05:57:06 +00:00
|
|
|
ld c, 5 * 5
|
|
|
|
cp 5
|
|
|
|
jr z, .got_dims
|
2017-12-09 19:22:58 +00:00
|
|
|
ld de, wDecompressEnemyFrontpic + 6 * 6 tiles
|
2016-01-29 05:57:06 +00:00
|
|
|
ld c, 6 * 6
|
|
|
|
cp 6
|
|
|
|
jr z, .got_dims
|
2017-12-09 19:22:58 +00:00
|
|
|
ld de, wDecompressEnemyFrontpic + 7 * 7 tiles
|
2016-01-29 05:57:06 +00:00
|
|
|
ld c, 7 * 7
|
|
|
|
.got_dims
|
|
|
|
|
|
|
|
push hl
|
|
|
|
push bc
|
2017-11-03 00:09:27 +00:00
|
|
|
call LoadFrontpicTiles
|
2016-01-29 05:57:06 +00:00
|
|
|
pop bc
|
|
|
|
pop hl
|
|
|
|
ld de, wDecompressScratch
|
|
|
|
ld a, [hROMBank]
|
|
|
|
ld b, a
|
|
|
|
call Get2bpp
|
|
|
|
xor a
|
|
|
|
ld [rVBK], a
|
|
|
|
ret
|
|
|
|
|
2017-11-03 00:09:27 +00:00
|
|
|
LoadFrontpicTiles: ; 5114f
|
2016-01-29 05:57:06 +00:00
|
|
|
ld hl, wDecompressScratch
|
|
|
|
swap c
|
|
|
|
ld a, c
|
|
|
|
and $f
|
|
|
|
ld b, a
|
|
|
|
ld a, c
|
|
|
|
and $f0
|
|
|
|
ld c, a
|
|
|
|
push bc
|
2018-01-16 19:30:10 +00:00
|
|
|
call LoadOrientedFrontpic
|
2016-01-29 05:57:06 +00:00
|
|
|
pop bc
|
2017-11-03 00:09:27 +00:00
|
|
|
.loop
|
2016-01-29 05:57:06 +00:00
|
|
|
push bc
|
2018-01-09 23:08:40 +00:00
|
|
|
ld c, 0
|
2018-01-16 19:30:10 +00:00
|
|
|
call LoadOrientedFrontpic
|
2016-01-29 05:57:06 +00:00
|
|
|
pop bc
|
|
|
|
dec b
|
2017-11-03 00:09:27 +00:00
|
|
|
jr nz, .loop
|
2016-01-29 05:57:06 +00:00
|
|
|
ret
|
|
|
|
|
2018-01-16 19:30:10 +00:00
|
|
|
GetMonBackpic: ; 5116c
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wCurPartySpecies]
|
2016-01-29 05:57:06 +00:00
|
|
|
call IsAPokemon
|
|
|
|
ret c
|
|
|
|
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wCurPartySpecies]
|
2016-01-29 05:57:06 +00:00
|
|
|
ld b, a
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wUnownLetter]
|
2016-01-29 05:57:06 +00:00
|
|
|
ld c, a
|
|
|
|
ld a, [rSVBK]
|
|
|
|
push af
|
2018-01-04 00:12:45 +00:00
|
|
|
ld a, BANK(wDecompressScratch)
|
2016-01-29 05:57:06 +00:00
|
|
|
ld [rSVBK], a
|
|
|
|
push de
|
|
|
|
|
2018-01-16 19:30:10 +00:00
|
|
|
; These are assumed to be at the same address in their respective banks.
|
2017-12-27 06:29:15 +00:00
|
|
|
ld hl, PokemonPicPointers ; UnownPicPointers
|
2016-01-29 05:57:06 +00:00
|
|
|
ld a, b
|
2017-12-27 06:29:15 +00:00
|
|
|
ld d, BANK(PokemonPicPointers)
|
2016-01-29 05:57:06 +00:00
|
|
|
cp UNOWN
|
|
|
|
jr nz, .ok
|
|
|
|
ld a, c
|
|
|
|
ld d, BANK(UnownPicPointers)
|
|
|
|
.ok
|
|
|
|
dec a
|
|
|
|
ld bc, 6
|
|
|
|
call AddNTimes
|
|
|
|
ld bc, 3
|
|
|
|
add hl, bc
|
|
|
|
ld a, d
|
|
|
|
call GetFarByte
|
|
|
|
call FixPicBank
|
|
|
|
push af
|
|
|
|
inc hl
|
|
|
|
ld a, d
|
|
|
|
call GetFarHalfword
|
|
|
|
ld de, wDecompressScratch
|
|
|
|
pop af
|
|
|
|
call FarDecompress
|
|
|
|
ld hl, wDecompressScratch
|
|
|
|
ld c, 6 * 6
|
|
|
|
call FixBackpicAlignment
|
|
|
|
pop hl
|
|
|
|
ld de, wDecompressScratch
|
|
|
|
ld a, [hROMBank]
|
|
|
|
ld b, a
|
|
|
|
call Get2bpp
|
|
|
|
pop af
|
|
|
|
ld [rSVBK], a
|
|
|
|
ret
|
|
|
|
|
|
|
|
FixPicBank: ; 511c5
|
|
|
|
; This is a thing for some reason.
|
2017-09-24 07:15:01 +00:00
|
|
|
|
|
|
|
PICS_FIX EQU $36
|
|
|
|
GLOBAL PICS_FIX
|
|
|
|
|
2016-01-29 05:57:06 +00:00
|
|
|
push hl
|
|
|
|
push bc
|
2018-05-29 23:14:04 +00:00
|
|
|
sub BANK("Pics 1") - PICS_FIX
|
2016-01-29 05:57:06 +00:00
|
|
|
ld c, a
|
|
|
|
ld b, 0
|
|
|
|
ld hl, .PicsBanks
|
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
pop bc
|
|
|
|
pop hl
|
|
|
|
ret
|
|
|
|
|
|
|
|
.PicsBanks: ; 511d4
|
2018-06-04 03:18:31 +00:00
|
|
|
db BANK("Pics 1") ; BANK("Pics 1") + 0
|
|
|
|
db BANK("Pics 2") ; BANK("Pics 1") + 1
|
|
|
|
db BANK("Pics 3") ; BANK("Pics 1") + 2
|
|
|
|
db BANK("Pics 4") ; BANK("Pics 1") + 3
|
|
|
|
db BANK("Pics 5") ; BANK("Pics 1") + 4
|
|
|
|
db BANK("Pics 6") ; BANK("Pics 1") + 5
|
|
|
|
db BANK("Pics 7") ; BANK("Pics 1") + 6
|
|
|
|
db BANK("Pics 8") ; BANK("Pics 1") + 7
|
|
|
|
db BANK("Pics 9") ; BANK("Pics 1") + 8
|
|
|
|
db BANK("Pics 10") ; BANK("Pics 1") + 9
|
|
|
|
db BANK("Pics 11") ; BANK("Pics 1") + 10
|
|
|
|
db BANK("Pics 12") ; BANK("Pics 1") + 11
|
|
|
|
db BANK("Pics 13") ; BANK("Pics 1") + 12
|
|
|
|
db BANK("Pics 14") ; BANK("Pics 1") + 13
|
|
|
|
db BANK("Pics 15") ; BANK("Pics 1") + 14
|
|
|
|
db BANK("Pics 16") ; BANK("Pics 1") + 15
|
|
|
|
db BANK("Pics 17") ; BANK("Pics 1") + 16
|
|
|
|
db BANK("Pics 18") ; BANK("Pics 1") + 17
|
|
|
|
db BANK("Pics 19") ; BANK("Pics 1") + 18
|
2018-05-29 23:14:04 +00:00
|
|
|
db BANK("Pics 1") + 19
|
|
|
|
db BANK("Pics 1") + 20
|
|
|
|
db BANK("Pics 1") + 21
|
|
|
|
db BANK("Pics 1") + 22
|
|
|
|
db BANK("Pics 1") + 23
|
2016-01-29 05:57:06 +00:00
|
|
|
|
|
|
|
Function511ec: ; 511ec
|
|
|
|
ld a, c
|
|
|
|
push de
|
2017-12-27 06:29:15 +00:00
|
|
|
ld hl, PokemonPicPointers
|
2016-01-29 05:57:06 +00:00
|
|
|
dec a
|
|
|
|
ld bc, 6
|
|
|
|
call AddNTimes
|
2017-12-27 06:29:15 +00:00
|
|
|
ld a, BANK(PokemonPicPointers)
|
2016-01-29 05:57:06 +00:00
|
|
|
call GetFarByte
|
|
|
|
call FixPicBank
|
|
|
|
push af
|
|
|
|
inc hl
|
2017-12-27 06:29:15 +00:00
|
|
|
ld a, BANK(PokemonPicPointers)
|
2016-01-29 05:57:06 +00:00
|
|
|
call GetFarHalfword
|
|
|
|
pop af
|
|
|
|
pop de
|
|
|
|
call FarDecompress
|
|
|
|
ret
|
|
|
|
|
2018-01-16 19:30:10 +00:00
|
|
|
GetTrainerPic: ; 5120d
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wTrainerClass]
|
2016-01-29 05:57:06 +00:00
|
|
|
and a
|
|
|
|
ret z
|
|
|
|
cp NUM_TRAINER_CLASSES
|
|
|
|
ret nc
|
|
|
|
call WaitBGMap
|
|
|
|
xor a
|
|
|
|
ld [hBGMapMode], a
|
|
|
|
ld hl, TrainerPicPointers
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wTrainerClass]
|
2016-01-29 05:57:06 +00:00
|
|
|
dec a
|
|
|
|
ld bc, 3
|
|
|
|
call AddNTimes
|
|
|
|
ld a, [rSVBK]
|
|
|
|
push af
|
2018-01-04 00:12:45 +00:00
|
|
|
ld a, BANK(wDecompressScratch)
|
2016-01-29 05:57:06 +00:00
|
|
|
ld [rSVBK], a
|
|
|
|
push de
|
|
|
|
ld a, BANK(TrainerPicPointers)
|
|
|
|
call GetFarByte
|
|
|
|
call FixPicBank
|
|
|
|
push af
|
|
|
|
inc hl
|
|
|
|
ld a, BANK(TrainerPicPointers)
|
|
|
|
call GetFarHalfword
|
|
|
|
pop af
|
|
|
|
ld de, wDecompressScratch
|
|
|
|
call FarDecompress
|
|
|
|
pop hl
|
|
|
|
ld de, wDecompressScratch
|
|
|
|
ld c, 7 * 7
|
|
|
|
ld a, [hROMBank]
|
|
|
|
ld b, a
|
|
|
|
call Get2bpp
|
|
|
|
pop af
|
|
|
|
ld [rSVBK], a
|
|
|
|
call WaitBGMap
|
|
|
|
ld a, $1
|
|
|
|
ld [hBGMapMode], a
|
|
|
|
ret
|
|
|
|
|
2018-01-16 19:30:10 +00:00
|
|
|
DecompressGet2bpp: ; 5125d
|
2016-01-29 05:57:06 +00:00
|
|
|
; Decompress lz data from b:hl to scratch space at 6:d000, then copy it to address de.
|
|
|
|
|
|
|
|
ld a, [rSVBK]
|
|
|
|
push af
|
2018-01-04 00:12:45 +00:00
|
|
|
ld a, BANK(wDecompressScratch)
|
2016-01-29 05:57:06 +00:00
|
|
|
ld [rSVBK], a
|
|
|
|
|
|
|
|
push de
|
|
|
|
push bc
|
|
|
|
ld a, b
|
|
|
|
ld de, wDecompressScratch
|
|
|
|
call FarDecompress
|
|
|
|
pop bc
|
|
|
|
ld de, wDecompressScratch
|
|
|
|
pop hl
|
|
|
|
ld a, [hROMBank]
|
|
|
|
ld b, a
|
|
|
|
call Get2bpp
|
|
|
|
|
|
|
|
pop af
|
|
|
|
ld [rSVBK], a
|
|
|
|
ret
|
|
|
|
|
|
|
|
FixBackpicAlignment: ; 5127c
|
|
|
|
push de
|
|
|
|
push bc
|
|
|
|
ld a, [wBoxAlignment]
|
|
|
|
and a
|
|
|
|
jr z, .keep_dims
|
|
|
|
ld a, c
|
|
|
|
cp 7 * 7
|
|
|
|
ld de, 7 * 7 tiles
|
|
|
|
jr z, .got_dims
|
|
|
|
cp 6 * 6
|
|
|
|
ld de, 6 * 6 tiles
|
|
|
|
jr z, .got_dims
|
|
|
|
ld de, 5 * 5 tiles
|
|
|
|
|
|
|
|
.got_dims
|
|
|
|
ld a, [hl]
|
2018-01-15 16:06:17 +00:00
|
|
|
ld b, 0
|
|
|
|
ld c, 8
|
2016-01-29 05:57:06 +00:00
|
|
|
.loop
|
|
|
|
rra
|
|
|
|
rl b
|
|
|
|
dec c
|
|
|
|
jr nz, .loop
|
|
|
|
ld a, b
|
|
|
|
ld [hli], a
|
|
|
|
dec de
|
|
|
|
ld a, e
|
|
|
|
or d
|
|
|
|
jr nz, .got_dims
|
|
|
|
|
|
|
|
.keep_dims
|
|
|
|
pop bc
|
|
|
|
pop de
|
|
|
|
ret
|
|
|
|
|
2017-11-03 00:09:27 +00:00
|
|
|
PadFrontpic: ; 512ab
|
2018-01-16 19:30:10 +00:00
|
|
|
; pads frontpic to fill 7x7 box
|
2016-01-29 05:57:06 +00:00
|
|
|
ld a, b
|
|
|
|
cp 6
|
|
|
|
jr z, .six
|
|
|
|
cp 5
|
|
|
|
jr z, .five
|
|
|
|
|
|
|
|
.seven_loop
|
|
|
|
ld c, $70
|
2018-01-16 19:30:10 +00:00
|
|
|
call LoadOrientedFrontpic
|
2016-01-29 05:57:06 +00:00
|
|
|
dec b
|
|
|
|
jr nz, .seven_loop
|
|
|
|
ret
|
|
|
|
|
|
|
|
.six
|
|
|
|
ld c, $70
|
|
|
|
xor a
|
|
|
|
call .Fill
|
|
|
|
.six_loop
|
|
|
|
ld c, $10
|
|
|
|
xor a
|
|
|
|
call .Fill
|
|
|
|
ld c, $60
|
2018-01-16 19:30:10 +00:00
|
|
|
call LoadOrientedFrontpic
|
2016-01-29 05:57:06 +00:00
|
|
|
dec b
|
|
|
|
jr nz, .six_loop
|
|
|
|
ret
|
|
|
|
|
|
|
|
.five
|
|
|
|
ld c, $70
|
|
|
|
xor a
|
|
|
|
call .Fill
|
|
|
|
.five_loop
|
|
|
|
ld c, $20
|
|
|
|
xor a
|
|
|
|
call .Fill
|
|
|
|
ld c, $50
|
2018-01-16 19:30:10 +00:00
|
|
|
call LoadOrientedFrontpic
|
2016-01-29 05:57:06 +00:00
|
|
|
dec b
|
|
|
|
jr nz, .five_loop
|
|
|
|
ld c, $70
|
|
|
|
xor a
|
|
|
|
call .Fill
|
|
|
|
ret
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
.Fill:
|
2016-01-29 05:57:06 +00:00
|
|
|
ld [hli], a
|
|
|
|
dec c
|
|
|
|
jr nz, .Fill
|
|
|
|
ret
|
|
|
|
|
2018-01-16 19:30:10 +00:00
|
|
|
LoadOrientedFrontpic: ; 512f2
|
2016-01-29 05:57:06 +00:00
|
|
|
ld a, [wBoxAlignment]
|
|
|
|
and a
|
|
|
|
jr nz, .x_flip
|
|
|
|
.left_loop
|
|
|
|
ld a, [de]
|
|
|
|
inc de
|
|
|
|
ld [hli], a
|
|
|
|
dec c
|
|
|
|
jr nz, .left_loop
|
|
|
|
ret
|
|
|
|
|
|
|
|
.x_flip
|
|
|
|
push bc
|
|
|
|
.right_loop
|
|
|
|
ld a, [de]
|
|
|
|
inc de
|
|
|
|
ld b, a
|
|
|
|
xor a
|
2018-01-15 16:06:17 +00:00
|
|
|
rept 8
|
2016-01-29 05:57:06 +00:00
|
|
|
rr b
|
|
|
|
rla
|
2018-01-15 16:06:17 +00:00
|
|
|
endr
|
2016-01-29 05:57:06 +00:00
|
|
|
ld [hli], a
|
|
|
|
dec c
|
|
|
|
jr nz, .right_loop
|
|
|
|
pop bc
|
|
|
|
ret
|