git.y1.nz

gbdk-2020

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

commit 8df4a4e82dc3f3ddff1d9609d2ab160ba0dfd4bd
parent f1e1764fa2b5118e428d8f8739b938f5c65619fa
Author: bbbbbr <reg+github@roughhousing.com>
Date:   Fri, 17 Sep 2021 22:01:23 -0700

Merge pull request #263 from bbbbbr/docs_4_0_5

Docs: updates for 4.0.5
Diffstat:
Mdocs/pages/06b_supported_consoles.md11++++++++---
Mdocs/pages/09_migrating_new_versions.md1+
Mdocs/pages/10_release_notes.md3++-
Mgbdk-lib/include/gb/hardware.h11++++++++++-
4 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/docs/pages/06b_supported_consoles.md b/docs/pages/06b_supported_consoles.md @@ -129,6 +129,11 @@ Use the following api calls when assets are avaialble in the native format for e - GB/AP: loads 1-byte-per-tile tilemaps - SMS/GG: loads 2-byte-per-tile tilemaps +There are also bit-depth specific API calls: +- 1bpp: @ref set_1bpp_colors, @ref set_bkg_1bpp_data, @ref set_sprite_1bpp_data +- 2bpp: @ref set_2bpp_palette, @ref set_bkg_2bpp_data, @ref set_sprite_2bpp_data, @ref set_tile_2bpp_data (sms/gg only) +- 2bpp: @ref set_bkg_4bpp_data (sms/gg only), @ref set_sprite_4bpp_data (sms/gg only) + ### Emulated Game Boy Color map attributes on the SMS/Game Gear On the Game Boy Color, @ref VBK_REG is used to select between the regular background tile map and the background attribute tile map (for setting tile color palette and other properties). @@ -143,7 +148,7 @@ GB/AP - Sprites: - 256 tiles (upper 128 are shared with background) (amount is doubled in CGB mode) - tile flipping/mirroring: yes - - 10 per line + - 40 total, max 10 per line - 2 x 4 color palette (color 0 transparent). 8 x 4 color palettes in CGB mode - Background: 256 tiles (typical setup: upper 128 are shared with sprites) (amount is doubled in CGB mode) - tile flipping/mirroring: no (yes in CGB mode) @@ -157,7 +162,7 @@ SMS/GG - Sprites: - 256 tiles (a bit less in the default setup) - tile flipping/mirroring: no - - 8 per line + - 64 total, max 8 per line - 1 x 16 color palette (color 0 transparent) - Background: 512 tiles (upper 256 are shared with sprites) - tile flipping/mirroring: yes @@ -182,6 +187,6 @@ SMS/GG - Display Controller (VDP) - Writing to the VDP should not be interrupted while an operation is already in progress (since that will interfere with the internal data pointer causing data to be written to the wrong location). - Recommended approach: Avoid writing to the VDP (tiles, map, scrolling, colors, etc) during an interrupt routine (ISR). - - Alternative, not recommended: Make sure writes to the VDP during an ISR are only performed when the @ref _shadow_OAM_OFF flag indicates it is safe to do so. + - Alternative (requires careful implementation): Make sure writes to the VDP during an ISR are only performed when the @ref _shadow_OAM_OFF flag indicates it is safe to do so. diff --git a/docs/pages/09_migrating_new_versions.md b/docs/pages/09_migrating_new_versions.md @@ -12,6 +12,7 @@ This section contains information that may be useful to know or important when u - The `_BASE` area is renamed to `_HOME` - Variables in static storage are now initialized to zero per C standard (but remaining WRAM is not cleared) - @ref itoa(), @ref uitoa(), @ref ltoa(), @ref ultoa() all now require a radix value (base) argument to be passed. On the Game Boy and Analogue Pocket the parameter is required but not utilized. +- set_bkg_1bit_data has been renamed to @ref set_bkg_1bpp_data ## Porting to GBDK 2020 4.0.4 - GBDK now requires SDCC 12238 or higher diff --git a/docs/pages/10_release_notes.md b/docs/pages/10_release_notes.md @@ -13,13 +13,14 @@ https://github.com/gbdk-2020/gbdk-2020/releases - Sega Master System (`sms`) and Game Gear (`gg`) - Library - Variables in static storage are now initialized to zero per C standard (but remaining WRAM is not cleared) - - Added new register flag constants and names. For example: + - Added many new register flag constants and names. For example: - @ref rLCDC is a new alias for @ref LCDC_REG - @ref LCDCF_WINON, @ref LCDCF_WINOFF, @ref LCDCF_B_WINON - Added @ref BANK(), @ref BANKREF(), @ref BANKREF_EXTERN() - Added @ref INCBIN(), @ref BANK(), @ref INCBIN_SIZE(), @ref INCBIN_EXTERN() - Added generic @ref SWITCH_ROM() and @ref SWITCH_RAM() - Added @ref BGB_printf() and updated bgb debug output. + - Added @ref set_native_tile_data(), @ref set_tile_map(), @ref set_1bpp_colors, @ref set_bkg_1bpp_data, @ref set_sprite_1bpp_data, @ref set_2bpp_palette, @ref set_bkg_2bpp_data, @ref set_sprite_2bpp_data, @ref set_tile_2bpp_data (sms/gg only), @ref set_bkg_4bpp_data (sms/gg only), @ref set_sprite_4bpp_data (sms/gg only) - Changed @ref itoa(), @ref uitoa(), @ref ltoa(), @ref ultoa() to now require a radix value (base) argument to be passed. On the Game Boy and Analogue Pocket the parameter is required but not utilized. - Examples - Added cross-platform examples (build for multiple consoles: gb, ap, sms, gg) diff --git a/gbdk-lib/include/gb/hardware.h b/gbdk-lib/include/gb/hardware.h @@ -72,6 +72,15 @@ __REG TAC_REG; /**< Timer control */ #define TACF_65KHZ 0b00000010 #define TACF_262KHZ 0b00000001 +#define SIOF_CLOCK_EXT 0b00000000 /**< Serial IO: Use External clock */ +#define SIOF_CLOCK_INT 0b00000001 /**< Serial IO: Use Internal clock */ +#define SIOF_SPEED_1X 0b00000000 /**< Serial IO: If internal clock then 8KHz mode, 1KB/s (16Khz in CGB high-speed mode, 2KB/s) */ +#define SIOF_SPEED_32X 0b00000010 /**< Serial IO: **CGB-Mode ONLY** If internal clock then 256KHz mode, 32KB/s (512KHz in CGB high-speed mode, 64KB/s) */ +#define SIOF_XFER_START 0b10000000 /**< Serial IO: Start Transfer. Automatically cleared at the end of transfer */ +#define SIOF_B_CLOCK 0 +#define SIOF_B_SPEED 1 +#define SIOF_B_XFER_START 7 + __REG IF_REG; /**< Interrupt flags: 0.0.0.JOY.SIO.TIM.LCD.VBL */ #define rIF IF_REG @@ -274,7 +283,7 @@ __REG KEY1_REG; /**< CPU speed */ #define KEY1F_DBLSPEED 0b10000000 #define KEY1F_PREPARE 0b00000001 -__REG VBK_REG; /**< VRAM bank */ +__REG VBK_REG; /**< VRAM bank select */ #define rVBK VBK_REG __REG HDMA1_REG; /**< DMA control 1 */ #define rHDMA1 HDMA1_REG

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