git.y1.nz

gbdk-2020

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

commit 853c89d2964920f04bf73ab96d316f35b5f2912c
parent 0a0ef277cd0385f553274a5ea08b7e5d45ebeec1
Author: Toxa <untoxa@mail.ru>
Date:   Sun, 26 May 2024 23:49:52 +0300

Merge branch 'develop' of https://github.com/gbdk-2020/gbdk-2020 into develop

Diffstat:
Mgbdk-lib/examples/cross-platform/scroller/src/text_scroller.c20++++++++++++--------
Mgbdk-lib/libc/targets/mos6502/nes/crt0.s2+-
2 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/gbdk-lib/examples/cross-platform/scroller/src/text_scroller.c b/gbdk-lib/examples/cross-platform/scroller/src/text_scroller.c @@ -1,4 +1,5 @@ #include <gbdk/platform.h> +#include <gbdk/font.h> #include <stdint.h> #include <stdio.h> @@ -17,14 +18,14 @@ void scanline_isr(void) { switch (_lcd_scanline) { case 0: move_bkg(0, 0); - _lcd_scanline = SCROLL_POS_PIX_START; + _lcd_scanline = SCROLL_POS_PIX_START + 1; break; - case SCROLL_POS_PIX_START: - move_bkg(scroller_x, SCROLL_POS_PIX_START); - _lcd_scanline = SCROLL_POS_PIX_END; + case SCROLL_POS_PIX_START + 1: + move_bkg(scroller_x, SCROLL_POS_PIX_START + 1); + _lcd_scanline = SCROLL_POS_PIX_END + 1; break; - case SCROLL_POS_PIX_END: - move_bkg(0, SCROLL_POS_PIX_END); + case SCROLL_POS_PIX_END + 1: + move_bkg(0, SCROLL_POS_PIX_END + 1); _lcd_scanline = 0; break; } @@ -64,10 +65,13 @@ uint8_t * base, * limit; void main(void) { DISPLAY_OFF; + // Init font system / clear screen + font_init(); + font_set(font_load(font_ibm)); // Fill the screen background with '*' fill_bkg_rect(0, 0, DEVICE_SCREEN_WIDTH, DEVICE_SCREEN_HEIGHT, '*' - ' '); - SHOW_BKG; SHOW_SPRITES; - + DISPLAY_ON; + printf(" Scrolling %d chars", sizeof(scroller_text) - 1); CRITICAL { diff --git a/gbdk-lib/libc/targets/mos6502/nes/crt0.s b/gbdk-lib/libc/targets/mos6502/nes/crt0.s @@ -422,7 +422,7 @@ _vsync:: lda *__lcd_scanline bne 0$ jsr .jmp_to_LCD_isr - lda #0 + lda #0xFF sta *.lcd_scanline_previous 0$: ; disable NMI, as we are saving and restoring shadow registers that it may use

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