git.y1.nz

gbdk-2020

GameBoy Development Kit
download: https://git.y1.nz/archives/gbdk.tar.gz
README | Files | Log | Refs | LICENSE

commit 1de0c20cb4cb76758196e00a8687478b600564a3
parent 7b7499d5e4cf132dafa1a2b1d23f5a989ee74fee
Author: Toxa <untoxa@mail.ru>
Date:   Wed, 22 Feb 2023 16:47:08 +0300

GB: simplify APA mode ISR

Diffstat:
Mgbdk-lib/libc/targets/sm83/drawing.s4+---
Mgbdk-lib/libc/targets/sm83/drawing_isr.s36++++++++++++++++--------------------
Mgbdk-lib/libc/targets/sm83/font.s3+--
3 files changed, 18 insertions(+), 25 deletions(-)

diff --git a/gbdk-lib/libc/targets/sm83/drawing.s b/gbdk-lib/libc/targets/sm83/drawing.s @@ -10,7 +10,7 @@ .globl .init_vram .globl .copy_vram - .globl .drawing_lcd, .drawing_vbl + .globl .drawing_lcd .globl .bg_colour, .fg_colour, .draw_mode .M_SOLID = 0x00 @@ -81,8 +81,6 @@ CALL .init_vram ; Init the charset at 0x8000 ;; Install interrupt routines - LD DE,#.drawing_vbl - CALL .add_VBL LD DE,#.drawing_lcd CALL .add_LCD diff --git a/gbdk-lib/libc/targets/sm83/drawing_isr.s b/gbdk-lib/libc/targets/sm83/drawing_isr.s @@ -1,23 +1,19 @@ - .include "global.s" + .include "global.s" - .area _HOME + .area _HOME -.drawing_vbl:: - LDH A,(.LCDC) - OR #LCDCF_BG8000 ; Set BG Chr to 0x8000 - LDH (.LCDC),A - - LD A,#72 ; Set line at which LCD interrupt occurs - LDH (.LYC),A - - RET - - ;; Is the STAT check required, as we are already in the HBL? .drawing_lcd:: - WAIT_STAT - - LDH A,(.LCDC) - AND #~LCDCF_BG8000 ; Set BG Chr to 0x8800 - LDH (.LCDC),A - - RET + ld hl, #rLCDC + ldh a, (rLYC) + cp #72 + jr z, 1$ + set LCDCF_B_BG8000, (hl) + ld a, #72 + ldh (rLYC), a + ret +1$: + WAIT_STAT + res LCDCF_B_BG8000, (hl) + ld a, #144 + ldh (rLYC), a + ret diff --git a/gbdk-lib/libc/targets/sm83/font.s b/gbdk-lib/libc/targets/sm83/font.s @@ -10,6 +10,7 @@ .globl .adv_curs .globl .cury, .curx .globl .display_off + .globl .drawing_lcd ; Structure offsets sfont_handle_sizeof = 3 @@ -525,8 +526,6 @@ _posy:: CALL .display_off ;; Remove any interrupts setup by the drawing routine - LD DE,#.drawing_vbl - CALL .remove_VBL LD DE,#.drawing_lcd CALL .remove_LCD 1$:

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.