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

Closed
wants to merge 90 commits into from
Closed
Show file tree
Hide file tree
Changes from 84 commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
c7dceea
upload progress.
Lokathor Apr 29, 2024
502f681
asm startup incomplete, but can boot a tiny example.
Lokathor May 13, 2024
3167926
CI fix
Lokathor May 13, 2024
b8bf23a
Merge branch 'main' into v0.12-dev
Lokathor May 13, 2024
a797074
fix up the changelog again.
Lokathor May 14, 2024
d1269d1
optionally use the `fixed` crate.
Lokathor May 14, 2024
f513b58
move the macro to the crate root, we'll use it elsewhere surely
Lokathor May 14, 2024
2a535b3
cover all features in CI, not just `fixed`
Lokathor May 14, 2024
e43928f
expand GbaCell to be useful.
Lokathor May 14, 2024
c9114de
correct the cfg problems.
Lokathor May 14, 2024
d855484
small rearrangement
Lokathor May 14, 2024
ca6d568
keyinput example works.
Lokathor May 14, 2024
865cb95
the linker script isn't linking right
Lokathor May 14, 2024
c048783
the whole example works now (the DMA offsets were miscalculated)
Lokathor May 14, 2024
5168cd2
docs
Lokathor May 14, 2024
305f01e
examples of all three bitmap modes.
Lokathor May 15, 2024
2405506
update the asm dumper
Lokathor May 15, 2024
5016b57
Transition to using the new `bracer` API
Lokathor May 22, 2024
6ee3fcb
comments
Lokathor May 22, 2024
2ab6e46
more comments
Lokathor May 22, 2024
8fa334e
that was necessary for the static after all.
Lokathor May 22, 2024
0d9d9d9
demo font art
Lokathor May 23, 2024
6e009b7
start of a mode0 example: we can decompress the sample tiles.
Lokathor May 23, 2024
506e2f0
we don't need that assembly file.
Lokathor May 23, 2024
09fc4bb
Add types for tile data.
Lokathor May 24, 2024
82922c5
delete junk files
Lokathor May 26, 2024
0e3493f
restore this example into the source tree
Lokathor May 26, 2024
9b32f67
pong is a trademark so we must use another name
Lokathor May 26, 2024
a658400
it compiles, but doesn't run right. probably we need to make the scre…
Lokathor May 26, 2024
2c04eec
part of the panic message in the ROM is getting copied to vram
Lokathor May 26, 2024
44e38ee
DMA source mode *must* be inc if the source addr is in ROM.
Lokathor May 26, 2024
3188fb4
delete old examples that we have replacements for.
Lokathor May 26, 2024
d7b002b
spelling
Lokathor May 26, 2024
c4748bf
update impls
Lokathor May 26, 2024
1bb4e7b
dma mmio
Lokathor May 26, 2024
4c18224
something about memset is messed up right now so the example doesn't …
Lokathor May 26, 2024
f01c3c2
restore mgba module
Lokathor May 26, 2024
7244b3f
why doesn't the green paddle move?
Lokathor May 27, 2024
b22a392
okay, in this state it runs the game.
Lokathor May 27, 2024
0339c3b
we should only set the instruction set on the GBA.
Lokathor May 27, 2024
0498d6c
put out small copy loop back into the crate source tree.
Lokathor May 27, 2024
f56796f
update dependency
Lokathor May 27, 2024
63ddcdf
Delete more old files.
Lokathor May 27, 2024
66340b4
mgba logging
Lokathor May 27, 2024
750ab26
update the runtime
Lokathor May 27, 2024
2f0481c
a new kind of panic handler.
Lokathor May 27, 2024
0aefd69
update the demo
Lokathor May 27, 2024
306f8f5
update the demo
Lokathor May 27, 2024
88ee89e
add memory set functions.
Lokathor May 27, 2024
9a37ec0
minor rename.
Lokathor May 27, 2024
9269339
use on_gba_or_unimplemented where necessary
Lokathor May 27, 2024
7fe46b6
move backup files to not be burried.
Lokathor May 27, 2024
869562b
a working objects demo.
Lokathor May 27, 2024
e10c617
pull more stuff in from backup.
Lokathor May 27, 2024
fed279b
we should log the panic errors, if they occur.
Lokathor May 27, 2024
354730c
this change causes the crash.
Lokathor May 29, 2024
2aa0f2d
this bulk set fn is more "obviously" correct, but the game still cras…
Lokathor May 29, 2024
534a4c5
This makes the program run again.
Lokathor May 30, 2024
aad5ddd
docs on setting the CPU
Lokathor May 31, 2024
692a8b2
Mode3::clear_to is a very fast and easily-proven-correct clear routine.
Lokathor May 31, 2024
be23117
added rectangle fill code with less bounds checks required.
Lokathor May 31, 2024
ed4d8a9
we'll have to do memset later, these impls are hopelessly inefficient
Lokathor Jun 2, 2024
948aa8e
update memory fns, and fix docs links
Lokathor Jun 2, 2024
2555648
update the asm runtime handler to call the user fn with the cpu in sy…
Lokathor Jun 2, 2024
59cdb72
delete these cargo features which no longer apply
Lokathor Jun 2, 2024
36870c2
delete the cfg that doesn't matter
Lokathor Jun 2, 2024
deae8ea
make u32x8 use less stack, and add more docs and notes
Lokathor Jun 2, 2024
ab424c8
rename gba_fixed methods to match the `fixed` crate's method names fo…
Lokathor Jun 3, 2024
35018e6
bios fns should be consistent about on_gba_or_unimplemented usage
Lokathor Jun 3, 2024
5e6d9f1
macros
Lokathor Jun 3, 2024
effab6f
finish out the IrqBits type setters
Lokathor Jun 3, 2024
d5400b7
break up the definitions into separate files for easier finding.
Lokathor Jun 3, 2024
7376e8b
we won't accept `self` for a ZST method if the ZST isn't guarding any…
Lokathor Jun 3, 2024
d3fdb93
limit `instruction_set` use
Lokathor Jun 3, 2024
e4024d6
weird bug
Lokathor Jun 3, 2024
f842a0a
whoops we gotta keep those masked off.
Lokathor Jun 3, 2024
21e7e99
this makes the asm runtime robust against bad emulators that don't se…
Lokathor Jun 3, 2024
2092429
rename the global, and also make the demo less visually intense
Lokathor Jun 3, 2024
57f5f3a
ditch the mmio module
Lokathor Jun 3, 2024
17371ea
good catch CI
Lokathor Jun 3, 2024
91dc918
docs link
Lokathor Jun 3, 2024
2c0336a
a32 halt functions
Lokathor Jun 3, 2024
f9cc5c7
Move USER_IRQ_HANDLER to the irq module
Lokathor Jun 3, 2024
ab39b96
docs
Lokathor Jun 3, 2024
b699e40
Resolve https://github.com/rust-console/gba/pull/195#discussion_r1657…
Lokathor Jun 30, 2024
dbd5032
Resolve https://github.com/rust-console/gba/pull/195#discussion_r1657…
Lokathor Jun 30, 2024
12457ad
Resolve https://github.com/rust-console/gba/pull/195#discussion_r1656…
Lokathor Jun 30, 2024
530c15b
Resolve https://github.com/rust-console/gba/pull/195#discussion_r1656…
Lokathor Jun 30, 2024
429211b
Resolve https://github.com/rust-console/gba/pull/195#discussion_r1656…
Lokathor Jun 30, 2024
cf3f8f9
Resolve https://github.com/rust-console/gba/pull/195#discussion_r1657…
Lokathor Jun 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ target = "thumbv4t-none-eabi"

[unstable]
build-std = ["core"]
build-std-features = ["compiler-builtins-weak-intrinsics"]

[target.thumbv4t-none-eabi]
runner = "mgba-qt"
rustflags = [
"-Zub-checks=no",
"-Clinker=arm-none-eabi-ld",
"-Clink-arg=-Tlinker_scripts/mono_boot.ld",
"--emit=mir",
"-Ctarget-cpu=arm7tdmi",
]
26 changes: 17 additions & 9 deletions .github/workflows/ci-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ jobs:
- { toolchain: nightly }
steps:
- uses: actions/checkout@v2

- name: Install Apt Dependencies
run: sudo apt-get update && sudo apt-get install binutils-arm-none-eabi

- uses: actions-rs/toolchain@v1
with:
Expand All @@ -25,10 +22,21 @@ jobs:

- name: Install Rust Source
run: rustup component add rust-src

- name: Install GNU Binutils
run: sudo apt-get update && sudo apt-get install binutils-arm-none-eabi

- name: Build The Examples
uses: actions-rs/cargo@v1
with:
toolchain: ${{ matrix.rust.toolchain }}
command: build
args: --examples
- name: Build The Examples (Link With GNU, weak compiler intrinsics)
run: cargo build --examples

- name: Check that all our features work
run: cargo build --examples --all-features

- name: Delete the .cargo/config.toml
run: rm -fr .cargo/config.toml

- name: Build The Examples (Link With LLD, strong compiler intrinsics)
run: RUSTFLAGS="-Clink-arg=-Tlinker_scripts/mono_boot.ld" cargo build --examples --target=thumbv4t-none-eabi -Zbuild-std=core

- name: Build The Crate For Host With No Default Features (build script usage simulation)
run: cargo build --no-default-features --lib
10 changes: 3 additions & 7 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
{
"rust-analyzer.checkOnSave.allTargets": false,
"rust-analyzer.checkOnSave.overrideCommand": [
"cargo",
"build",
"--quiet",
"--workspace",
"--message-format=json",
"rust-analyzer.cargo.allTargets": false,
"rust-analyzer.check.command": "build",
"rust-analyzer.check.extraArgs": [
"--lib",
"--bins",
"--examples"
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 0.12
* A totally new version!

## 0.11 and older

* **0.11.6:**
* `on_gba` feature (default: enabled) that signals if the crate is running on a GBA.
Limited portions of the crate *can* be used even when not on the GBA (such as in a build script).
Expand Down
30 changes: 22 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,49 @@
name = "gba"
description = "A crate for 'raw' style GBA development. If you want a 'managed' experience, try the `agb` crate instead."
repository = "https://github.com/rust-console/gba"
version = "0.11.6"
version = "0.12.0"
edition = "2021"
license = "Zlib OR Apache-2.0 OR MIT"

[features]
default = ["track_caller", "on_gba"]
track_caller = []
default = ["on_gba"]
# SEE THE CRATE DOCS FOR SAFETY RELATED INFO REGARDING THIS FEATURE.
on_gba = []
# utilize `doc_cfg` where appropriate. requires nightly. intended mostly for use
# during docs.rs documentation generation.
doc_cfg = []
# Activates the `track_caller` attribute on various functions. Use of the
# `track_caller` attribute on a function adds a "secret" extra argument for the
# `Location` of the caller, which can reduce performance if the function is not
# inlined (meaning `Location` is passed via the stack). This is only needed for
# debugging, and so it's off by default.
track_caller = []

[dependencies]
voladdress = "1.3.0"
voladdress = "1.4.0"
bitfrob = "1"
bracer = "0.1.2"
critical-section = { version = "1.1.2", features = [
"restore-state-bool",
], optional = true }
bytemuck = { version = "1.16.0", optional = true }
fixed = { version = "1.27.0", default-features = false, optional = true }
bracer = "0.3.1"

[profile.dev]
opt-level = 3
incremental = false

[profile.dev.package."*"]
# this prevents `core` from having way too many debug assertions
debug-assertions = false

[profile.release]
codegen-units = 1
codegen-units = 1 # increases build time, but also can increase inline opportunities
incremental = false

[package.metadata.docs.rs]
# The crate can only be built for targets that have thumb-interworking support,
# because otherwise the instruction_set attribute can't be used.
# When building the crate docs, we want to see the crate "as if" it was running
# on the GBA. This is the closest target that docs.rs supports by default and
# which *also* supports the `instruction_set` attribute to avoid build errors.
targets = ["armv5te-unknown-linux-gnueabi"]
features = ["doc_cfg"]
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,21 @@

This crate is intended for working with the GBA.

To build for the GBA you'll need to use `build-std` and you'll also need to
activate the `compiler-builtins-weak-intrinsics` feature.
To build for the GBA you'll need to use `build-std` (on Nightly) with the
`thumbv4t-none-eabi` or `armv4t-none-eabi` targets. The two targets are
identical except for which instruction set (thumb or arm) is used by default. It
is suggested that you use the thumb target, unless you know what you're doing and
have a very good reason to use the arm target.

The following should be somewhere in your `.cargo/config.toml`:
Your `.cargo/config.toml` should look something like this:

```toml
[build]
target = "thumbv4t-none-eabi"

[unstable]
build-std = ["core"]
build-std-features = ["compiler-builtins-weak-intrinsics"]
```

If you don't use this crate on the GBA, you **MUST** disable default features and
then not use the `on_gba` cargo feature.
Loading
Loading