-
Notifications
You must be signed in to change notification settings - Fork 71
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
Added various features #651
Conversation
I haven't given this an in-depth review yet, but here's some preliminary feedback:
This commit contains multiple separate changes and should be split up, with each commit introducing one feature and a short but descriptive commit title following the style of previous commits.
The printing functionality in pbkit is a bit of a legacy feature - pbkit is currently a wild mix of high- and low-level code, and the printing code is most likely going to be removed soon-ish, so imho it doesn't make much sense to add features to it. It's only still here because it can help with debugging.
The makefile is a remnant from the early days of nxdk, I'd actually recommend against using it for anything other than building nxdk itself. We've been working on removing the need for it by adding wrapper scripts for the compiler and CMake support, and we'll eventually remove it.
Hmmm, interesting. I'll try to find some time to experiment with this, but if there really is no other way we should probably put that info into the nxdk wiki. This review might sound a bit negative, but be assured that I really do appreciate people upstreaming fixes and features 👍 |
Splitting up the commits for cxbe might take a bit since I will need to go into the code and manually undo the changes in reverse order then redo them |
For pbkit, I'll probably steal pbkit's text functions directly and paste them into my rendering code lol For the Makefile, I am relying on calling it from my actual Makefile using this little snippet:
|
For the |
- Increased the buffer sizes from 9 to 256 which now makes the max section name length 255 chars - Added code in Exe.cpp to parse long section names (they begin with /) - Modified code in Xbe.cpp to write out sections names longer than 8 chars
Caused by strcasecmp on line 1413 comparing "name" which may not have a null terminator
The Title ID is interpreted in Main.cpp and passed as x_dwTitleID when creating the XBE. Title IDs can be in human-readable form (like CX-9999) or a hex code (like 4358270F). Strings without - in them are tried as hex codes.
Region flags can be 'a' for all regions, '-' for no regions, or any combo of 'n' for North America, 'j' for Japan, 'w' for world, and/or 'm' for manufacturing
The version is interpreted by strtoul() which can do decimal, hex, and octal
- Added XBE_TITLEID, XBE_REGION, and XBE_VERSION to take advantage of the new Cxbe features - Added an objcopy line (with || exit 0 to make sure it doesn't fail the build) to rename XTIMAGE to $$XTIMAGE and XSIMAGE to $$XSIMAGE - The default for XBE_TITLEID is FFFF0002 for compatibility reasons. The new default in Cxbe is 4358270F to match CX-9999.
Ok @thrimbor I split up the cxbe commits and also removed the changes to pbkit 👍 |
// Old value was 8 which caused problems // For example, $$XTIMAGE and $$XSIMAGE are 9 bytes long not including null
and changed the long section interpreter to assume not a long section if there is something other than numbers after the /
@JayFoxRox I fixed all of the issues I think |
…$XSIMAGE bInsertedFile, bHeadPageRO, and bTailPageRO should be set and bPreload should be cleared otherwise it causes memory/stack corruption when running the XBE (my theory is that it overwrites some program data with the image data unless you clear bPreload). A more permanent solution would probably be to add an option set the flags for specific sections.
I no longer use NXDK's Makefile to build the XBE so I reverted this change. I now only use the NXDK Makefile to build the tools and libs.
Another little "hack" to clear the preload flag on sections named .debug or starting with .debug_ so they won't be loaded and waste memory
IDK how to make the "This branch cannot be rebased due to conflicts" message go away so I'm going to open a new PR and see if that works. |
tools/cxbe
:FFFF0002
) or a human-readable code (likeCX-9999
)Makefile
:XBE_TITLEID
to define a title ID (goes to cxbe as-TITLEID:$(XBE_TITLEID)
)XBE_REGION
to define a title ID (goes to cxbe as-REGION:$(XBE_REGION)
)XBE_VERSION
to define a title ID (goes to cxbe as-VERSION:$(XBE_VERSION)
)