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

This will be the v0.12 version #195

Open
wants to merge 90 commits into
base: main
Choose a base branch
from
Open

This will be the v0.12 version #195

wants to merge 90 commits into from

Conversation

Lokathor
Copy link
Member

@Lokathor Lokathor commented May 13, 2024


TODO:

  • improve the module organization so that the public api is clear. among other things this means that we should probably delete the mmio module and just place controls and their data types into each peripheral's module (Video, Timers, etc).
  • Update all previous examples
  • Basic VBlank+KeyInput example
  • Bitmap demos
  • Tiled demos
  • Affine demos
  • Object demos
  • DMA support
  • Graphic Effect Demos
  • Timer demos
  • Generated Sound Demo
  • Wave Sound Demo
  • SRAM usage
  • mGBA logging
  • Make the Assembly Runtime switch the CPU to System mode when calling the User's IRQ handler written in Rust (because Rust is a stack memory hog).
  • Make t32 and a32 versions of key BIOS calls so that they can always cleanly inline
  • Add a warning to the user that the GBA has no stack protection mechanism, and so they must be careful about stack overflow.

@Lokathor Lokathor self-assigned this May 14, 2024
@Lokathor
Copy link
Member Author

@zesterer You're the closest i have to a reviewer. This needs work to be complete and to be consistent, but I hope most of the direction of this is clear and looks good.

examples/mode4.rs Outdated Show resolved Hide resolved
#[repr(transparent)]
pub struct KeyInput(u16);
pub struct KeyInput(pub u16);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd love a keys.changes_from(keys_old) here, quite useful when trying to detect key presses, especially given than the BitAnd impl seems to have gone.

Edit: Perhaps keys.presses_since(keys_old) and keys.releases_since(keys_old) actually?

src/lib.rs Show resolved Hide resolved
src/sample_art.rs Show resolved Hide resolved
src/timers.rs Outdated Show resolved Hide resolved
src/gba_cell.rs Show resolved Hide resolved
/// This is used by the affine matrix entries.
#[allow(non_camel_case_types)]
pub type i16fx8 = Fixed<i16, 8>;
//! Basic fixed point math module used as a fallback if the `fixed` crate isn't
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know I mentioned it before, but I'd like to see all of this track_caller-ed to hell and back. Extra important given that the default GBA targets don't support unwinding so the only panic location you get is the one the compiler gives you at the panic site.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, bytemuck integration would be lovely. num_traits too, if at all possible. I've ended up writing my own fixed-point type because sadly these types don't fill these gaps.

src/keys.rs Show resolved Hide resolved
src/per_project_setup.rs Outdated Show resolved Hide resolved
Comment on lines +84 to +85
//! The full standard library isn't available on the GBA, it's a [bare metal]
//! environment, so we'll only have access to the [`core`] crate.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe mention alloc + give hints about where to go when looking to set it up? I don't use it myself, but I gather that it's common to place the heap in ewram. Something like linked_list_allocator seems like a good choice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider depending on fixed crate for fixed point, instead of reimplementing
2 participants