git.y1.nz

gbdk-2020

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

commit ea81835299f96ec374550f6df8a79d928b5f5469
parent effcf9c52b5c501dadbcd12ee6c88cc893916619
Author: Toxa <untoxa@mail.ru>
Date:   Sun, 12 Jun 2022 16:34:26 +0300

GB: update examples for using of the new VBK_TILES/VBK_ATTRIBUTES definitions

Diffstat:
Mgbdk-lib/examples/ap/colorbar/colorbar.c4++--
Mgbdk-lib/examples/ap/dscan/dscan.c4++--
Mgbdk-lib/examples/cross-platform/logo/src/main.c4++--
Mgbdk-lib/examples/gb/colorbar/colorbar.c4++--
Mgbdk-lib/examples/gb/dscan/dscan.c4++--
5 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/gbdk-lib/examples/ap/colorbar/colorbar.c b/gbdk-lib/examples/ap/colorbar/colorbar.c @@ -56,12 +56,12 @@ int main(void) set_bkg_data( 0x0, 32, bar_c ); /* Select VRAM bank 1 */ - VBK_REG = 1; + VBK_REG = VBK_ATTRIBUTES; /* Set attributes */ set_bkg_tiles( 0, 0, bar_mWidth, bar_mHeight, bar_a ); /* Select VRAM bank 0 */ - VBK_REG = 0; + VBK_REG = VBK_TILES; /* Set data */ set_bkg_tiles( 0, 0, bar_mWidth, bar_mHeight, bar_m ); diff --git a/gbdk-lib/examples/ap/dscan/dscan.c b/gbdk-lib/examples/ap/dscan/dscan.c @@ -128,7 +128,7 @@ void set_bkg_attr( uint8_t x, uint8_t y, uint8_t sx, uint8_t sy, unsigned char * { uint8_t xx, yy; - VBK_REG = 1; /* select palette bank */ + VBK_REG = VBK_ATTRIBUTES; /* select palette bank */ for( yy=0; yy<sy; yy++ ) { for( xx=0; xx<sx; xx++ ) { msg_tile[xx] = bkgCGB[(unsigned int)*d]; @@ -136,7 +136,7 @@ void set_bkg_attr( uint8_t x, uint8_t y, uint8_t sx, uint8_t sy, unsigned char * } set_bkg_tiles( x, y+yy, sx, 1, msg_tile ); } - VBK_REG = 0; /* select data bank */ + VBK_REG = VBK_TILES; /* select data bank */ } uint8_t make_rnd( uint8_t i ) diff --git a/gbdk-lib/examples/cross-platform/logo/src/main.c b/gbdk-lib/examples/cross-platform/logo/src/main.c @@ -15,13 +15,13 @@ void main() { set_native_tile_data(0, GBDK_2020_logo_TILE_COUNT, GBDK_2020_logo_tiles); #if defined(SYSTEM_CGB) if (_cpu == CGB_TYPE) { - VBK_REG = 1; + VBK_REG = VBK_ATTRIBUTES; set_tile_map((DEVICE_SCREEN_WIDTH - (GBDK_2020_logo_WIDTH >> 3)) >> 1, (DEVICE_SCREEN_HEIGHT - (GBDK_2020_logo_HEIGHT >> 3)) >> 1, GBDK_2020_logo_WIDTH >> 3, GBDK_2020_logo_HEIGHT >> 3, GBDK_2020_logo_map_attributes); - VBK_REG = 0; + VBK_REG = VBK_TILES; } #endif set_tile_map((DEVICE_SCREEN_WIDTH - (GBDK_2020_logo_WIDTH >> 3)) >> 1, diff --git a/gbdk-lib/examples/gb/colorbar/colorbar.c b/gbdk-lib/examples/gb/colorbar/colorbar.c @@ -56,12 +56,12 @@ int main(void) set_bkg_data( 0x0, 32, bar_c ); /* Select VRAM bank 1 */ - VBK_REG = 1; + VBK_REG = VBK_ATTRIBUTES; /* Set attributes */ set_bkg_tiles( 0, 0, bar_mWidth, bar_mHeight, bar_a ); /* Select VRAM bank 0 */ - VBK_REG = 0; + VBK_REG = VBK_TILES; /* Set data */ set_bkg_tiles( 0, 0, bar_mWidth, bar_mHeight, bar_m ); diff --git a/gbdk-lib/examples/gb/dscan/dscan.c b/gbdk-lib/examples/gb/dscan/dscan.c @@ -128,7 +128,7 @@ void set_bkg_attr( uint8_t x, uint8_t y, uint8_t sx, uint8_t sy, unsigned char * { uint8_t xx, yy; - VBK_REG = 1; /* select palette bank */ + VBK_REG = VBK_ATTRIBUTES; /* select palette bank */ for( yy=0; yy<sy; yy++ ) { for( xx=0; xx<sx; xx++ ) { msg_tile[xx] = bkgCGB[(unsigned int)*d]; @@ -136,7 +136,7 @@ void set_bkg_attr( uint8_t x, uint8_t y, uint8_t sx, uint8_t sy, unsigned char * } set_bkg_tiles( x, y+yy, sx, 1, msg_tile ); } - VBK_REG = 0; /* select data bank */ + VBK_REG = VBK_TILES; /* select data bank */ } uint8_t make_rnd( uint8_t i )

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