gbdk-2020 | GameBoy Development Kit |
| download: https://git.y1.nz/archives/gbdk.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit fd44443fc6729001640af08679b86627bfa9a9e3 parent c5c3a451ce49dc4b9f36fba0a28e6ade0d422ddb Author: Michel Iwaniec <46843052+michel-iwaniec@users.noreply.github.com> Date: Sun, 10 May 2026 11:55:18 +0100 GB: Add set_win_attribute_xy function (#885) Diffstat:
| M | gbdk-lib/include/gb/gb.h | 16 | ++++++++++++++++ |
1 file changed, 16 insertions(+), 0 deletions(-)
diff --git a/gbdk-lib/include/gb/gb.h b/gbdk-lib/include/gb/gb.h @@ -1708,6 +1708,22 @@ void get_win_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *tiles) O */ uint8_t * set_win_tile_xy(uint8_t x, uint8_t y, uint8_t t); +/** Set single attribute data a on window layer at x,y + @param x X-coordinate + @param y Y-coordinate + @param a tile attributes + @return returns the address of tile attribute, so you may use faster set_vram_byte() later + + @note On the Game Boy this is only usable in Game Boy Color mode +*/ +inline uint8_t * set_win_attribute_xy(uint8_t x, uint8_t y, uint8_t a) +{ + uint8_t* addr; + VBK_REG = VBK_ATTRIBUTES; + addr = set_win_tile_xy(x, y, a); + VBK_REG = VBK_TILES; + return addr; +} /** * Get single tile t on window layer at x,y
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.