gbdk-2020 | GameBoy Development Kit |
| download: https://git.y1.nz/archives/gbdk.tar.gz | |
| README | Files | Log | Refs | LICENSE |
gbdk-lib/libc/targets/sm83/color.s
1 .include "global.s"
2
3 ;; Data
4 .area _INITIALIZED
5 __current_1bpp_colors::
6 ;; Foreground drawing colour
7 .fg_colour::
8 .ds 1
9 ;; Background drawing colour
10 .bg_colour::
11 .ds 1
12 ;; Drawing mode (.SOILD etc)
13 .draw_mode::
14 .ds 1
15
16 .area _INITIALIZER
17
18 .db 0x03 ; .fg_colour
19 .db 0x00 ; .bg_color
20 .db 0x00 ; .draw_mode
21
22 .area _HOME
23 _set_1bpp_colors_ex::
24 _color::
25 LDA HL,2(SP) ; Skip return address and registers
26 LD A,(HL+) ; A = Foreground
27 LD (.fg_colour),a
28 LD A,(HL+)
29 LD (.bg_colour),a
30 LD A,(HL)
31 LD (.draw_mode),a
32 RET
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.