gbdk-2020 | GameBoy Development Kit |
| download: https://git.y1.nz/archives/gbdk.tar.gz | |
| README | Files | Log | Refs | LICENSE |
gbdk-lib/libc/targets/z80/set_tile_map_compat.s
1 .include "global.s"
2
3 .title "VRAM utilities"
4 .module VRAMUtils
5
6 .globl .set_tile_map_xy
7
8 .area _HOME
9
10 ; void set_tile_map(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles) __z88dk_callee __preserves_regs(iyh, iyl);
11 _set_tile_map_compat::
12 pop hl ; HL = ret
13 pop bc ; BC = YX
14 pop de ; DE = WH
15 ex (sp), hl ; HL = data
16 ex de, hl ; HL = WH, DE = data
17
18 ld a, b
19 ld b, d
20
21 add #.SCREEN_Y_OFS
22 ld d, a
23 xor a
24 FAST_MOD8 d #28
25 ld d, a
26
27 ld a, c
28 add #.SCREEN_X_OFS
29 and #0x1f
30 ld c, e
31 ld e, a ; BC = data, DE = YX
32
33 jp .set_tile_map_xy_compat
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.