gbdk-2020 | GameBoy Development Kit |
| download: https://git.y1.nz/archives/gbdk.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit 9e2fa7e9451a733dcd310cdbae4fbe073e922a5b parent 9353d57f70e175b0617eee167b7ff7fb862c0ae3 Author: Toxa <untoxa@mail.ru> Date: Fri, 19 Mar 2021 13:44:48 +0300 fixed vram wrapping for string copy in gb_decompress_*_data() Diffstat:
| M | gbdk-lib/libc/gb/gb_decompress_tiles.s | 31 | +++++++++++++++++++++++++++---- |
1 file changed, 27 insertions(+), 4 deletions(-)
diff --git a/gbdk-lib/libc/gb/gb_decompress_tiles.s b/gbdk-lib/libc/gb/gb_decompress_tiles.s @@ -10,6 +10,14 @@ loc: .endm +.macro UNWRAP_VRAM regH, ?loc + bit 3, regH + jr nz, loc + set 4, regH +loc: +.endm + + .area _CODE _gb_decompress_bkg_data:: @@ -43,6 +51,7 @@ _gb_decompress_sprite_data:: ; hl = source; de = dest gb_decompress_vram:: push bc + push de 1$: ld a,(hl+) ; load command or a @@ -95,16 +104,28 @@ gb_decompress_vram:: and a,#63 inc a push hl + ld c,(hl) inc hl ld b,(hl) + + ldhl sp,#3 + bit 4,(hl) ; check start address was above 0x9000 + jr z, 11$ + ld h,d ld l,e add hl,bc + UNWRAP_VRAM h + jr 12$ +11$: + ld h,d + ld l,e + add hl,bc +12$: ld c,a - call 10$ - + pop hl inc hl inc hl @@ -116,15 +137,17 @@ gb_decompress_vram:: call 10$ - jr 1$ ; next command + jp 1$ ; next command 9$: + pop de pop bc ret 10$: - WAIT_STAT + WAIT_STAT ld a,(hl+) ld (de),a + WRAP_VRAM h inc de WRAP_VRAM d dec c
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.