aboutsummaryrefslogtreecommitdiff
path: root/src/ubox/ubox_get_tile.z80
blob: 3a6004d686ffbda11bca81b5a19666413a7d8020 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
.globl _ubox_get_tile

RDVRM = 0x004a
BG_TILE_MAP = 0x1800

_ubox_get_tile::
	ld hl, #2
	add hl, sp

	ld b, #0
	ld c, (hl)
	inc hl
	ld l, (hl)

	ld h, #0
	add hl, hl
	add hl, hl
	add hl, hl
	add hl, hl
	add hl, hl
	add hl, bc

	ld bc, #BG_TILE_MAP
	add hl, bc

	call RDVRM
	ld l, a
	ret