git.y1.nz

gbdk-2020

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

commit e679322a5351c522a84cd03e17474fabe4c2e2a9
parent 0679a7323e9f66c10a05f693df69677835d99160
Author: Toxa <untoxa@mail.ru>
Date:   Tue, 12 Sep 2023 12:14:27 +0300

GB: improve SIO control register flags definitions

Diffstat:
Mgbdk-lib/include/gb/hardware.h22+++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/gbdk-lib/include/gb/hardware.h b/gbdk-lib/include/gb/hardware.h @@ -56,6 +56,19 @@ __REG SB_REG; /**< Serial IO data buffer */ #define rSB SB_REG __REG SC_REG; /**< Serial IO control register */ #define rSC SC_REG + +#define SIOF_XFER_START 0b10000000 /**< Serial IO: Start Transfer. Automatically cleared at the end of transfer */ +#define SIOF_CLOCK_INT 0b00000001 /**< Serial IO: Use Internal clock */ +#define SIOF_CLOCK_EXT 0b00000000 /**< Serial IO: Use External 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_B_CLOCK 0 +#define SIOF_B_SPEED 1 +#define SIOF_B_XFER_START 7 +#define SCF_START SIOF_XFER_START +#define SCF_SOURCE SIOF_CLOCK_INT +#define SCF_SPEED SIOF_SPEED_32X + __REG DIV_REG; /**< Divider register */ #define rDIV DIV_REG __REG TIMA_REG; /**< Timer counter */ @@ -72,15 +85,6 @@ __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

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