gbdk-2020 | GameBoy Development Kit |
| download: https://git.y1.nz/archives/gbdk.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit 87776e0b465a2b4f86d1343b3ebf51c102aae323 parent f1c1c824016c901e7bb0b41c7ff317895b58e1d8 Author: Toxa <untoxa@mail.ru> Date: Wed, 20 Jan 2021 17:21:42 +0300 export of shadow_OAM_base Diffstat:
| M | gbdk-lib/include/gb/gb.h | 3 | +++ |
| M | gbdk-lib/libc/gb/crt0.s | 12 | ++++++++---- |
| M | gbdk-lib/libc/gb/global.s | 1 | + |
3 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/gbdk-lib/include/gb/gb.h b/gbdk-lib/include/gb/gb.h @@ -983,6 +983,9 @@ typedef struct OAM_item_t { */ extern volatile struct OAM_item_t shadow_OAM[]; +/** MSB of shadow_OAM address is used by OAM DMA copying routine +*/ +__REG _shadow_OAM_base; /** Sets sprite number __nb__ to display tile number __tile__. diff --git a/gbdk-lib/libc/gb/crt0.s b/gbdk-lib/libc/gb/crt0.s @@ -167,11 +167,14 @@ _reset:: .code_start:: DI ; Disable interrupts LD D,A ; Store CPU type in D - XOR A ;; Initialize the stack LD SP,#.STACK - LD HL,#_shadow_OAM + LD A, #>_shadow_OAM + LDH (__shadow_OAM_base), A + LD H, A + XOR A + LD L, A LD C, #(40 << 2) ; 40 entries 4 bytes each RST 0x28 @@ -284,7 +287,7 @@ _set_interrupts:: ;; Copy OAM data to OAM RAM .start_refresh_OAM: - LD A,#>_shadow_OAM + LDH A,(__shadow_OAM_base) LDH (.DMA),A ; Put A into DMA registers LD A,#0x28 ; We need to wait 160 ns 1$: @@ -342,7 +345,8 @@ __current_bank:: ; Current bank .ds 0x01 .vbl_done: .ds 0x01 ; Is VBL interrupt finished? - +__shadow_OAM_base:: + .ds 0x01 ;; Runtime library .area _GSINIT gsinit:: diff --git a/gbdk-lib/libc/gb/global.s b/gbdk-lib/libc/gb/global.s @@ -121,6 +121,7 @@ .endif .globl __current_bank + .globl __shadow_OAM_base ;; Global variables .globl .mode
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.