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 NDS port #53

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Add NDS port #53

wants to merge 7 commits into from

Conversation

Lorenzooone
Copy link
Contributor

Separated version.

  • Changed various numbers to be dependant on the screen size, to make them work regardless of the system.
  • Changed certain macros that were used to have the same name as the NDS ones (if already present).
  • To have the graphics update for the bottom screen as well, various pieces of code had to be (sadly) duplicated. Where possible, functions were created, but that wasn't always the case.
  • Overscan's window had to be split in two subwindows due to multiple NDS bugs with windows.

Not specified, but due to a bug with swiUnpackBits in the current release of BlocksDS, a version > 0.14.0 must be used (so I built it using master for now).
Hopefully an updated release is released soon!

Requires #52 to be merged in first (so the common commits are removed).

@Lorenzooone Lorenzooone force-pushed the nds_port branch 4 times, most recently from b8bd198 to ecbde5e Compare March 18, 2024 19:54
@pinobatch
Copy link
Owner

I have no access to the nds-dev package through dkp-pacman because devkitPro has banned my computer's IP address. With what toolchain not published by devkitPro should I attempt to evaluate this pull request?

@Lorenzooone
Copy link
Contributor Author

Lorenzooone commented Mar 21, 2024

This uses BlocksDS, so, for Linux:
https://blocksds.github.io/docs/setup/options/linux/
In particular, in step 2 you'll want to use these commands for now, as the latest release has a bug that has only been fixed on git:

wf-pacman -S thirdparty-blocksds-git-toolchain \
             thirdparty-blocksds-git-docs

Sorry if it wasn't instantly clear...

@pinobatch
Copy link
Owner

Now that I've begun to bootstrap off devkitARM, I can start tackling this. First, I'd like to see this port split into multiple pull requests that I can review individually:

  1. variable screen size
  2. macro renaming
  3. Overscan window refactor
  4. actually add the DS port
    Also would it be better to display everything on both screens or on one screen at a time? The latter approach would make help always visible on sub and add a button to swap whether the Top Screen or the Touch Screen is main.

@Lorenzooone
Copy link
Contributor Author

Lorenzooone commented Apr 1, 2024

Making multiple PRs would be a nightmare in terms of commits, rebases and conflicts.
I can make it into a single PR with multiple commits, though. Since they are closely related to one another and they'd touch the same lines.
You'll just need to look at the commit you want to analyze.

For the screens: I went with the first one so one can test both screens at the same time, and if they see something, they can reference the other screen to check how things should appear.
Also, the current way makes it more robust for users not having both screens working.
Plus, how would you handle input for the help screen?

@Lorenzooone
Copy link
Contributor Author

Lorenzooone commented Apr 1, 2024

Done.
Split the PR into multiple commits.

c697ccb is the commit in which I swap things around for the GBA build to account for NDS bugs. This means both for the Windows in overscan.c and for the hdmaTable for hill_zone_scroll.

Windows bugs:

  • You cannot create a window on NDS which covers the whole 256 pixels on the x axys. It needs to be two windows.
  • If you have a window y start value < 7 when the VCOUNT register rolls over, the window will start from 0 instead. Meaning that if your window y start value is > 0 && < 7, you need to edit it after that VCOUNT rolls over. I used a single fire DMA at the first HBlank to do that.

hdmaTable issue:

  • You cannot DMA stuff which is in a core's cache on NDS. So I moved it to VRAM.

The rest of the commits should be self-explanatory.

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