gbdk-2020 | GameBoy Development Kit |
| download: https://git.y1.nz/archives/gbdk.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit 8840ba5f4d4f16024cdb7020478087cd3a9110c8 parent b278b3556913f95e15017a8309b226849b7fbe40 Author: Toxa <untoxa@mail.ru> Date: Thu, 9 Sep 2021 09:27:57 +0300 SMS/GG: fix mess with 1bpp color palette Diffstat:
| M | gbdk-lib/include/sms/sms.h | 2 | +- |
| M | gbdk-lib/libc/targets/z80/color.s | 6 | +++--- |
| M | gbdk-lib/libc/targets/z80/font.s | 3 | --- |
| M | gbdk-lib/libc/targets/z80/set_1bpp_data.s | 4 | ++-- |
4 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/gbdk-lib/include/sms/sms.h b/gbdk-lib/include/sms/sms.h @@ -528,7 +528,7 @@ inline void set_sprite_2bpp_data(uint16_t start, uint16_t ntiles, const void *sr extern uint16_t _current_1bpp_colors; inline void set_1bpp_colors(uint8_t fgcolor, uint8_t bgcolor) { - _current_1bpp_colors = ((uint16_t)fgcolor << 8) | bgcolor; + _current_1bpp_colors = ((uint16_t)bgcolor << 8) | fgcolor; } void set_tile_1bpp_data(uint16_t start, uint16_t ntiles, const void *src, uint16_t colors) __z88dk_callee __preserves_regs(iyh,iyl); inline void set_bkg_1bpp_data(uint16_t start, uint16_t ntiles, const void *src) { diff --git a/gbdk-lib/libc/targets/z80/color.s b/gbdk-lib/libc/targets/z80/color.s @@ -6,12 +6,12 @@ .area _INITIALIZED __current_1bpp_colors:: -.bg_colour:: - .ds 1 .fg_colour:: .ds 1 +.bg_colour:: + .ds 1 .area _INITIALIZER - .db 0x00 ; .bg_color .db 0x03 ; .fg_colour + .db 0x00 ; .bg_color diff --git a/gbdk-lib/libc/targets/z80/font.s b/gbdk-lib/libc/targets/z80/font.s @@ -64,9 +64,6 @@ _font_color:: pop de ex (sp), hl push de - ld a, h - ld h, l - ld l, a ld (__current_1bpp_colors), hl ret diff --git a/gbdk-lib/libc/targets/z80/set_1bpp_data.s b/gbdk-lib/libc/targets/z80/set_1bpp_data.s @@ -60,10 +60,10 @@ _set_tile_1bpp_data:: srl c jr c, 10$ - ld a, ixl + ld a, ixh jr 11$ 10$: - ld a, ixh + ld a, ixl 11$: rra rr 0 (iy)
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.