Skip to content

Rename RAMB_RTC_DH_* flags to RTCREG_DH_* - #92

Merged
Rangi42 merged 1 commit into
gbdev:v6.0.0-rc1from
Rangi42:rtc-flags
Aug 11, 2026
Merged

Rename RAMB_RTC_DH_* flags to RTCREG_DH_*#92
Rangi42 merged 1 commit into
gbdev:v6.0.0-rc1from
Rangi42:rtc-flags

Conversation

@Rangi42

@Rangi42 Rangi42 commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Supersedes #81.

These flag bits apply to the value mapped into [rRTCREG], not the value of [rRAMB]. rRAMB is only involved because writing the RAMB_RTC_DH sentinel value to it maps the RTC DH flags into [rRTCREG].

@Rangi42
Rangi42 requested a review from avivace August 11, 2026 19:35
@Rangi42 Rangi42 mentioned this pull request Aug 11, 2026
@Rangi42
Rangi42 changed the base branch from master to v6.0.0-rc1 August 11, 2026 19:44
@Rangi42

Rangi42 commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator Author

An example from pokecrystal:

StartRTC:
	ld a, RAMG_SRAM_ENABLE
	ld [rRAMG], a
	call LatchClock
	ld a, RAMB_RTC_DH
	ld [rRAMB], a
	ld a, [rRTCREG]
	res B_RAMB_RTC_DH_HALT, a
	ld [rRTCREG], a
	call CloseSRAM
	ret

This would make more sense after a rename:

StartRTC:
	ld a, RAMG_SRAM_ENABLE
	ld [rRAMG], a
	call LatchClock
	ld a, RAMB_RTC_DH
	ld [rRAMB], a
	ld a, [rRTCREG]
	res B_RTCREG_DH_HALT, a
	ld [rRTCREG], a
	call CloseSRAM
	ret

@Rangi42
Rangi42 merged commit bf08a7e into gbdev:v6.0.0-rc1 Aug 11, 2026
2 checks passed
@Rangi42
Rangi42 deleted the rtc-flags branch August 11, 2026 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants