-
-
Notifications
You must be signed in to change notification settings - Fork 96
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
Add CPU mode select register - KEY0 #580
Conversation
Add the register decription to the CGB Registers page and updated the CGB flag cartrigde and the Power Up Sequence with refs to the new register PGB mode remains a mystery
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.
I'd like to avoid basing information on leaks. If those registers have indeed an effect, can't they be tested and documented following a clean-room design?
I suggest that pandocs describe usable registers. Features requiring hardware manipulation should get their own page. Under normal circumstances, this register is only writable by putting a value in ROM byte $143. It doesn't have a use that makes sense. If this register gets added, I suggest something like this:
Some more info: https://forums.nesdev.org/viewtopic.php?p=248353&sid=693346db893528869f0907b1d5008897#p248353 |
I think a true cleanroom process is unlikely to happen here, and I'm not sure it would even be very useful. What would that even mean here? Recruiting a GB programmer who has not seen the leaks, to make a test ROM? This test ROM would then have to run in the boot ROM context, which would require a very specific setup. That's a lot of extra work that I'm not sure would serve much actual (legal) purpose. I agree however that information should not be copied directly from leaked documents without being tested. Apart from the leaks, you would also have to consider other sources like...
So for example, by studying the boot ROM disassembly, you can reach the following conclusions:
I think an approach like that would be viable. Then there's the names. Should we just pretend we don't know the names of these registers? Pan Docs is already filled with register names that were somehow leaked from the programming manual during the console's commercial lifespan. I would expect the register names to be a minor enough detail that it's not actually a legal risk. Obligatory disclaimer that I'm not a lawyer. |
Hi thanks for the constructive comments and the new info about this register (I suspected it gets locked after the boot process ends but couldn't find any info about it). I agree with @nitro2k01 that a clean room implementation will be hard to implement (maybe just verify that the register is not writable/have effect after the boot ends) considering a boot context is needed. In retrospective I might gave too much credit to the leak in this PR info then necessary:
So maybe we can just omit those PGB names (although they already present in other places) and just treat them as unknown? |
I don't think there's any value in pretending we don't know stuff we do know, only to openly discuss it just about everywhere else and tell newcomers "yeah, we wrote down unknown, but we just lied". |
I don't think it's about lying about not knowing it. Or at least in this case, it is lying about knowing it. If this info were acquired using any form of "self-resarch", you'd have much more to say about these registers than that was said here, test ROM or not. And even if I didn't know about the existance of this info leaking, I'd be still suspicious about this being copypasted from somewhere, as even if you only tested the four values presented in $FF6C, you'd know that with one of the modes it doesn't seem to even reach $0100, and thus can't even execute a STOP to switch mode. And if somehow a method was found to bypass that, I hope it would be also written down. |
You know about this information. You're describing it! Anything described here is known, because the messages wouldn't exist if it wasn't. So yes, it is lying about knowing it. You can't simultaneously describe how something works and claim you know nothing about how it works. |
I think the intent is to keep Pan Docs lawful to distribute even in those jurisdictions whose trade secret law restricts copying ideas (not expression) from a source that someone knows or has reason to know is a leak. As ax6 has told me several times in the gbdev Discord server, not all the world is the United States, or Germany, or Argentina, or Japan. However, we need to keep the law of GitHub's home country at top of mind as long as Pan Docs is hosted on GitHub. For this reason, I recommend explicitly describing observable behavior, with instructions on how to observe it. Because we don't yet know the behavior of "PGB" modes to an extent that we can rig up a test cart that uses them, we can truthfully describe their behavior as unknown. You could start with wording to this effect: "This GBC-only register is written by the boot ROM. It has no effect after the game starts. Its behavior is not testable without hardware manipulation." "When the value at $0143 in the header is at least $80, it controls various aspects of the GBC system, some related to compatibility with original Game Boy games. Values $80 and $C0 are typical, placing the system in ordinary GBC mode. Value X enters a monochrome mode with a blank palette that cannot be changed later. Some values prevent the boot ROM from jumping to $0100 in the first place." |
As I said on Discord, it's save to assume that nocash wrote the notes that he posted in that thread before the leak. Remove the speculation about bit 3 (which is probably even wrong) and you have all information that I think is relevant for Pan Docs.
We don't pretend that we don't know. We really don't know. As pinobatch proposed, we should describe observable behaviour. You might even call it actual behaviour. You cannot (currently) observe what bit 3 does. |
Hi, thanks again everyone for the constructive comments. I have just pushed new changes based on your suggestions that does not depends on the leaks as a reference. I have tried not to make big changes in the "power up sequence" and "the cartridge header" sections but they are already using the "PGB mode" terminology. Let me know what you think. |
src/CGB_Registers.md
Outdated
|
||
#### Bit 3 and "PGB mode" | ||
|
||
It has been speculated based on leaked documents that setting bit 3 is related to a special mode called "PGB" for controlling the LCD externally. |
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.
I would move this inside the "research needed" boxes and avoid mentioning where the speculation comes from. I'd make this generic and link from the Research Needed box an issue here on github where we can discuss / contribute to this specific topic
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.
What's the reason to mention bit 3 at all anyway?
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.
Yeah, exactly, I don't see a reason for it at the moment. We can have the speculation/discussions in a issue and simply link to it
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.
Since other sections (like the OPRI register) mentions PGB mode with the values activating it I thought it will help to avoid confusion regarding those values.
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.
Just pushed new changes and opened a new issue addressing most of the comments except for bit 3 so Im not resolving this yet.
Let me know what you think regarding the other sections mentioning PGB mode values.
I think that this should wait some more time. Every few hours we find new information. What is known for sure:
More meaningful research will probably come a month or so later, unless we have more breakthrough. |
Move the pgb mode brief to the research needed box and add a link to a new issue regarding this topic
Glad to hear the research is advancing! Also updating that I opened a new issue #581 (like @avivace suggested) to continue the discussions and contributions on this topic. |
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.
last grammar fixed then I'd say we can merge
Co-authored-by: Antonio Vivace <[email protected]>
The change in |
@nummacway could you send a PR? |
Recent Discord discussions concerning GBDev's doc build processes confused me so much that I'm too afraid to edit anything. |
@nummacway Ouch. I run locally almost all the gbdev projects weekly and they run perfectly fine. Let's start from the beginning together, could you try following https://github.com/gbdev/pandocs/blob/master/DEPLOY.md ? Once you git pull, you can also use the Docker option and skip building. Let me know anything that comes up |
Add the register description to the CGB Registers page and updated the CGB flag cartridge and the Power Up Sequence with refs to the new register.
This PR mostly uses ISSOtm/gb-bootroms@8513822 as a source for the register description which is based on leaks (hope it is OK).
Edit:
This PR now does not uses leaked documents as a source but acknowledge them as other sections are relaying on them.
Edit 2:
This PR now does not uses leaked documents.