Skip to content
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 necessary features for LgyBg and Process9 development #151

Merged
merged 3 commits into from
Jul 20, 2024

Conversation

TuxSH
Copy link

@TuxSH TuxSH commented Jul 14, 2024

I am currently developing a replacement for AgbBg and TwlBg that would fix the bad upscaling that the official module suffers from.

To that end, I am adding the following features:

[makerom] Add -baremetal flag

This is the simplest workaround to us not supporting multiple phdr per "segment"
(looking at Process9 and TwlBg, Nintendo's tooling seems to support this usecase).

K9 and legacy FIRM k11 don't have memory management and have everything
be RWX. We can exploit how they load CIPs to have the segment be
anything, and be able to be loaded at any VMA (first segment defines LMA
and entrypoint, however). With this flag, the first phdr in the .elf
file is always chosen as the "code" segment and so on.

For example, we can have a FCRAM segment where the image is initially
loaded and jumped to, as the first segment, then an AXIWRAM segment. For
TwlBg, Nintendo seems to have a RWX phdr inside the code "segment" that
it relocates to AXIWRAM, but we don't support this.

[makerom] Add -pagesize option

Kernel9 uses pagesize=0x100 instead of the usual 0x1000.

(one can notice it when using ctrtool on Process9)

[makerom] Remove 32 interrupt ID limitation

TuxSH added 3 commits July 14, 2024 20:36
This is a workaround to us not supporting multiple phdr per "segment".

K9 and legacy FIRM k11 don't have memory management and have everything
be RWX. We can exploit how they load CIPs to have the segment be
anything, and be able to be loaded at any VMA (first segment defines LMA
and entrypoint, however). With this flag, the first phdr in the .elf
file is always chosen as the "code" segment and so on.

For example, we can have a FCRAM segment where the image is initially
loaded and jumped to, as the first segment, then an AXIWRAM segment. For
TwlBg, Nintendo seems to have a RWX phdr inside the code "segment" that
it relocates to AXIWRAM, but we don't support this.

"-baremetal" implies "-nocodepadding".
Kernel9 uses pagesize=0x100 instead of the usual 0x1000.
@jakcron
Copy link
Collaborator

jakcron commented Jul 20, 2024

Oh cool, thanks for the PR, I'll merge it and make some tweaks (add it to the help text and define some constants)

@jakcron jakcron merged commit 681d17d into 3DSGuy:master Jul 20, 2024
9 checks passed
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