-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable early /OE in more configurations #8
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2452,12 +2452,19 @@ _more_inits02:: | |
ld hl, GCSRShadow | ||
ld (hl), a | ||
|
||
lcall _getDoublerSetting | ||
|
||
ld a, l | ||
lcall _getDoublerSetting ; get doubler setting value into L (h always 0) | ||
ld a, L | ||
or a ; update the Zero flag | ||
jr z, .notDoubled | ||
|
||
ld a, 0x0C ; value to set both /OE0 and /OE1 early output | ||
ioi ld (MTCR), a ; first, update /OE0, /OE1 early output enable | ||
ld (MTCRShadow), a | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change, backported from Dynamic C PR 30, enables "early /OE" before enabling the clock doubler. Note that Dynamic C 9 could use the existing code from that sets MTCR and its shadow to 0 if the clock doubler is disabled, since there isn't any code earlier in the BIOS attempting to set it (as the Dynamic C 10 patch does for the RCM4110). |
||
|
||
.notDoubled: | ||
ld a, L ; recover the doubler setting value | ||
ioi ld (GCDR), a ; next, update clock doubler setting | ||
ld (GCDRShadow), a | ||
ioi ld (GCDR), a ; set clock doubler now | ||
|
||
|
||
#if _CPU_ID_ >= R2000_R3 | ||
lcall _enableClockModulation ; enables spreader | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change ensures that we don't disable "early /OE" if it was previously enabled. Startup default is disabled (0x00), but the
StdBios.c
change around line 2455 will automatically enable it on all products with a doubled clock, and later code in this function enables it before turning on the spectrum spreader.