Commit graph

1385 commits

Author SHA1 Message Date
jmaargh 4a13d52faf Resolve TODOs about linker symbols 2023-10-16 22:50:53 +01:00
jmaargh 7a1f554b72 Fix symbols for RAM section locations
Using the ld functions is not only more readable, but more accurate.
Previous use of the `.` variable could occasionally have off-by-one
errors.
2023-10-16 22:46:27 +01:00
jmaargh 9040844854 Reserve IWRAM space for BIOS use 2023-10-16 22:45:59 +01:00
Gwilym Inzani 7454563325 Tests must come at the end 2023-10-07 20:28:09 +01:00
Gwilym Inzani 53685b0410 Release v0.17.1 2023-10-05 22:18:04 +01:00
Gwilym Inzani c280316fa2 Update Cargo.toml files so docs.rs is happy 2023-10-04 16:36:46 +01:00
Gwilym Inzani b6916d7e74 Release v0.17.0 2023-10-03 22:33:10 +01:00
Corwin fc721ea060
Bitmap4 fix (#487)
Expands on #486 by updating example and updating changelog.

- [x] Changelog updated
2023-09-28 21:35:21 +01:00
Corwin 74ccdfcd7f
update example to excersise the broken case 2023-09-28 21:19:07 +01:00
xokz 575976bf52
Update bitmap4.rs 2023-09-28 15:03:24 -04:00
xokz cf80e313b1
Update bitmap4.rs
colors of lower values can now overwrite colors of higher values.
2023-09-28 14:46:32 -04:00
Corwin 473181718b
remove outer loop 2023-09-14 13:28:00 +01:00
Corwin c12ae4b5d9
add safety comments to public unsafe functions 2023-09-14 12:44:34 +01:00
Gwilym Inzani 5b3248ec5a Massively improve the code generation around tile sizes 2023-09-06 08:51:47 +01:00
Gwilym Inzani ed2e7dec5c Let rust do the register allocation 2023-09-06 08:34:14 +01:00
Gwilym Inzani bb57298c54 This has better code generation 2023-09-06 00:37:23 +01:00
Gwilym Inzani 77445b304f Custom assembly as thumb 2023-09-06 00:23:01 +01:00
Gwilym Inzani e504b93fe3 Write a custom tile copy command 2023-09-05 23:52:35 +01:00
Gwilym Inzani 7431086b14 Try using memcpy4 for copying the tile data 2023-08-31 07:53:08 +01:00
Gwilym Inzani d3c32ce351 Minor optimisation for the show entire screen case 2023-08-31 07:53:01 +01:00
Gwilym Inzani 2c556f9ce8 Fix docs for real this time 2023-08-30 17:02:06 +01:00
Gwilym Inzani dc04785669 Fix doc examples 2023-08-30 16:46:05 +01:00
Gwilym Inzani 11fe4d92ac Delete the old toml file 2023-08-30 16:25:16 +01:00
Gwilym Inzani 3a1f8ed8ed Add a convienence fill_with method 2023-08-30 16:22:55 +01:00
Gwilym Inzani f0ddfc96b4 Reference the TRANSPARENT_TILE_INDEX in the definition of BLANK 2023-08-30 16:18:08 +01:00
Gwilym Inzani 6853d36a9c Dynamic tile can also return the setting directly 2023-08-30 16:14:51 +01:00
Gwilym Inzani 5cfa64030a Generate the tileset directly 2023-08-30 16:08:43 +01:00
Gwilym Inzani 9abfa7f8e1 Update documentation 2023-08-29 16:20:54 +01:00
Gwilym Inzani b5991d3ccc Copy all the tiles for a 256 colour map 2023-08-29 16:14:05 +01:00
Gwilym Inzani a865240308 Start fixing 256 colours 2023-08-29 16:07:50 +01:00
Gwilym Inzani 9db4230aee Better error if we run out of VRam 2023-08-29 15:34:07 +01:00
Gwilym Inzani c9bf56755a Also deduplicate for the dungeon puzzler 2023-08-29 15:17:50 +01:00
Gwilym Inzani 3d7d3f25a2 Update agb repo 2023-08-29 14:13:40 +01:00
Gwilym Inzani b5af3a3aff Generate tile settings instead of palette assignments 2023-08-29 14:07:19 +01:00
Gwilym Inzani dc46cfef45 If r2 < 4 don't overwrite all memory 2023-08-22 20:15:26 +01:00
Corwin 3430668bdd
change name of cycle measure function and remove from public api 2023-08-08 09:48:10 +01:00
Gwilym Inzani 11f71371e2 Be less happy with what we allow 2023-08-06 21:02:15 +01:00
Gwilym Inzani 46c9ebb855 Derive default to make bilge 2.0 happy (and may as well) 2023-08-06 21:02:15 +01:00
renovate[bot] 24070fdd18 Update Rust crate bilge to 0.2 2023-08-06 21:02:15 +01:00
Corwin ba62aca590
add example for saving 2023-08-05 11:53:14 +01:00
Gwilym Inzani 3da10f11be Use my new married name in all the places it appeared 2023-07-26 10:29:03 +01:00
Gwilym Inzani 9445a57f48 Channel counts as finished if the channel position reaches the end of the effect 2023-07-25 23:24:40 +01:00
Gwilym Inzani e8e5b31d42 No need to use a generic here any more 2023-07-25 00:50:47 +01:00
Gwilym Inzani f7b3aa8ecb Don't need lr to be saved since we're not using it 2023-07-25 00:27:20 +01:00
Gwilym Inzani 49b9a07a87 Give the same assembly treatment to mono sounds 2023-07-25 00:18:48 +01:00
Gwilym Inzani de666a54f9 Core loop for the tracker in assembly 2023-07-24 23:59:54 +01:00
Gwilym Inzani df75d1ce8c Fix build errors 2023-07-23 23:39:52 +01:00
Gwilym Inzani a4df095031 Improve accuracy of the panning and volume until the last second 2023-07-23 22:15:30 +01:00
Gwilym Inzani b593b90701 Get the docs building 2023-07-23 19:52:11 +01:00
Gwilym Inzani 352658f23f Fix clippy lints 2023-07-23 19:08:51 +01:00
Gwilym Inzani 1aa8e5fd33 Reintroduce the first special casing 2023-07-22 23:40:09 +01:00
Gwilym Inzani d6384a6886 This improves mixing performance by about 20% 2023-07-22 23:27:21 +01:00
Gwilym Inzani 03b5f2fafd Remove unused methods 2023-07-18 21:51:38 +01:00
Gwilym Inzani de085fc1ff Use wrapping add and mul 2023-07-18 21:37:01 +01:00
Gwilym Inzani 7861571a96 Correctly track restart point 2023-07-18 21:37:01 +01:00
Gwilym Inzani 1dd4c9fb83 Add a concept of a restart point 2023-07-18 21:37:01 +01:00
Gwilym Inzani c66f495cc7 Don't need loop labels any more 2023-07-18 21:37:01 +01:00
Gwilym Inzani d929a1689a Extract methods 2023-07-18 21:37:01 +01:00
Gwilym Inzani 938f05f8d1 Compile in release and make actually safe 2023-07-18 21:37:01 +01:00
Gwilym Inzani d4b2a2bc1a Fix crackly audio 2023-07-18 21:37:01 +01:00
Gwilym Inzani 8191de3546 Try a pure rust implementation to allow for looping correctly 2023-07-18 21:37:01 +01:00
Gwilym Inzani a61069fb60 Handle non multiple of 4 buffer sizes for mono 2023-07-18 21:37:01 +01:00
Gwilym Inzani eb8cb667c1 Extract to macros 2023-07-18 21:37:01 +01:00
Gwilym Inzani fc4632ca8a Only need to load the buffer size once 2023-07-18 21:37:01 +01:00
Gwilym Inzani d38fea7f7a Pass the buffer size rather than using the global variable for it 2023-07-18 21:37:01 +01:00
Corwin a7f9fdf011
Release v0.16.0 2023-07-18 18:55:12 +01:00
Corwin 1db3a61ee3
allow new clippy lint 2023-07-18 18:34:56 +01:00
Corwin 636e31aa91
uncomment out code 2023-07-04 22:35:12 +01:00
Corwin 3687f9b1a5
Merge remote-tracking branch 'upstream/master' into font-renderer 2023-07-04 22:27:06 +01:00
Corwin 0cd469866c
font get optimisation 2023-07-04 21:35:00 +01:00
Corwin 991bb644f9
timers around area of interest 2023-07-04 21:34:51 +01:00
Gwilym Inzani 14c6542e7b Clippy fix didn't delete a space 2023-07-04 20:37:26 +01:00
Gwilym Inzani 6fb7b74b35 Fix clippy lints from 04/07/2023 2023-07-04 20:10:01 +01:00
Corwin c5a7e9a25b
Merge remote-tracking branch 'upstream/master' into font-renderer 2023-07-02 14:59:07 +01:00
Corwin 318ee03c12
fix doclinks 2023-07-02 14:57:01 +01:00
Corwin b82ed16cc2
update test image 2023-07-02 14:55:30 +01:00
Corwin 5c0f855e1b
use newer rustfmt 2023-07-02 14:32:09 +01:00
Corwin fa7a71e0d3
add docs and export 2023-07-02 13:08:54 +01:00
Corwin 66a212f29a
remove unused 2023-07-02 13:08:44 +01:00
Corwin 9388098318
JUSTIFY 2023-07-02 00:38:52 +01:00
Corwin 9edbca582e
magic colour changing 2023-07-02 00:24:54 +01:00
Corwin 5f12040752
the proper nice okay working text rendering 2023-07-01 23:36:58 +01:00
Corwin ec3003c81d
garbage renderer 2023-07-01 19:12:39 +01:00
Corwin 93024f6bab
remove some unused bits 2023-06-29 20:04:27 +01:00
Corwin cf400029f5
caching layout 2023-06-29 00:10:21 +01:00
Corwin f947d82049
text rendering that supports different alignments 2023-06-28 20:29:09 +01:00
Gwilym Inzani 13f5fe01d7 Actually use the new first methods 2023-06-27 22:34:45 +01:00
Corwin d5d3d1a658
strip to bare renderer 2023-06-27 22:00:34 +01:00
Corwin 22b3497bb3
fix 2023-06-27 21:56:26 +01:00
Corwin fd82b259cc
dynamic sprite allocate directly into sprite vram 2023-06-27 21:56:09 +01:00
Gwilym Inzani 3b35061a3a Extract iterator to a variable 2023-06-27 21:51:59 +01:00
Gwilym Inzani 38868cb269 Extract even more from the loop body 2023-06-27 21:50:46 +01:00
Gwilym Inzani 57f0a8c889 Remove is_done check in for loop 2023-06-27 21:49:30 +01:00
Gwilym Inzani f4779208e3 Implement first cases for the non stereo 2023-06-27 21:48:01 +01:00
Gwilym Inzani e1d03929f9 Use local labels 2023-06-27 21:33:56 +01:00
Gwilym Inzani 306be59cde Add implementation for if this is the first 2023-06-27 21:31:06 +01:00
Corwin ce7bcacb3c
somewhat mad left align renderer 2023-06-26 23:47:19 +01:00
Corwin b75303863d
buffered text render 2023-06-26 17:10:42 +01:00
Corwin 87ac2fe53c
reuse dynamic sprite 2023-06-26 17:10:42 +01:00
Corwin b99fff7c8e
some object based text rendering 2023-06-26 17:10:03 +01:00
Corwin aa38a03ac9
add read pixel method 2023-06-26 17:10:03 +01:00
Corwin dbf7715e67 use assert_eq and collect 2023-06-20 21:52:07 +01:00
Corwin 389e3ecadb make test not reliant on coincidence alignment 2023-06-20 21:52:07 +01:00
Gwilym Inzani 5a374ba4f0 Add collapse test and fix bug uncovered by it 2023-06-18 16:29:02 +01:00
Gwilym Inzani b2dcd8c854 Pass buffer size as an argument 2023-06-18 16:02:14 +01:00
Gwilym Inzani ba18a0bf4a ldmia again 2023-06-16 23:43:37 +01:00
Gwilym Inzani e72de28961 Can I use movne here instead? 2023-06-16 23:41:15 +01:00
Gwilym Inzani ceb57eb002 r12 is a scratch register 2023-06-16 22:22:03 +01:00
Gwilym Inzani 334e70c664 Do multiple loads at once 2023-06-16 22:19:56 +01:00
Gwilym Inzani 9e08303e62 Extract a macro for this 2023-06-16 22:15:45 +01:00
Gwilym Inzani 6cf3ecaf36 Don't need to save r9 2023-06-16 22:11:44 +01:00
Corwin 28e3a7faf4
Resolve stutter upon switching to dice customise screen (#442)
1. Dealloc now uses the normal dealloc procedure.
    * Better because normalisation is quick, O(1).
    * More normalisation means inserting into the list is faster.
2. Run sfx frame during the generation of upgrades (which can take an
unbounded amount of time).

* Both of these are required to remove the stuttering.
* It sounds really weird now that it works right :/

- [ ] Changelog updated / no changelog update needed
2023-06-05 21:01:12 +01:00
Corwin 53937b4fa8
Upcast multiply (#436)
- [ ] Changelog updated / no changelog update needed
2023-06-05 21:00:46 +01:00
Corwin 6b84833c4f
remove dealloc_no_normalise 2023-06-05 00:12:36 +01:00
Corwin 083fd43ea3
just dealloc in gc 2023-06-05 00:12:36 +01:00
Corwin 77c4741ee7
hide objects by default 2023-06-03 16:06:23 +01:00
Corwin b5704afe5e
remove usize 2023-06-01 18:52:03 +01:00
Gwilym Inzani da5aed83e3
Use bilge rather than modular-bitfield (#430)
Thought I'd give bilge a go rather than modular bitfield after reading
this blog post:
https://hecatia-elegua.github.io/blog/no-more-bit-fiddling/

- [ ] Changelog updated / no changelog update needed
2023-05-30 20:41:46 +01:00
Corwin 7e111e0327
remove unused import 2023-05-25 19:30:38 +01:00
Corwin 9c15adf6c8
only normalise the relevant blocks 2023-05-25 19:25:26 +01:00
Gwilym Inzani 903157325f Don't recalculate the hash 2023-05-23 21:20:49 +01:00
Corwin d638134d37
remove codegen-units
these were added as a workaround for rust bugs
2023-05-23 20:10:24 +01:00
Gwilym Inzani 1b27bf4613 Remove codegen-units = 1 since it won't be needed any more 2023-05-21 16:37:35 +01:00
Gwilym Inzani 958f32b177 Include macros.inc properly 2023-05-21 16:37:35 +01:00
Gwilym Inzani 78bad29f88 Add codegen-units=1 to prevent miscompiles 2023-05-21 16:37:35 +01:00
Gwilym Inzani fe23bee18b Prevent multiple include errors 2023-05-21 16:37:35 +01:00
Gwilym Inzani 5ab0176ddb Entirely remove the need for binutils 2023-05-21 16:37:34 +01:00
Corwin df696a1093
align after section 2023-05-18 12:06:30 +01:00
Corwin e1426d8ef7
correct non thumb-interwork return 2023-05-17 23:25:27 +01:00
Corwin 9f3259d770
fix alignment of thumb functions defined in assembly 2023-05-17 19:56:57 +01:00
Gwilym Inzani 644e94f8ed Use bilge rather than modular-bitfield 2023-05-17 15:01:22 +01:00
Corwin 1cbc371d3e
go through colours in order rather than randomly 2023-05-07 23:41:17 +01:00
Corwin 64308a993c
use mag squared 2023-05-07 00:47:38 +01:00
Corwin 83c511a186
neaten the letter M 2023-05-06 23:59:47 +01:00
Corwin 7ae3afab6c
add example for no_game 2023-05-06 22:54:22 +01:00
Corwin cb8b42d416
don't use the loader 2023-05-06 22:53:09 +01:00
Corwin d4314213da
use palette in no game to save on not useful aseprite file 2023-05-06 22:45:30 +01:00
Corwin f95d68187b
make dynamic sprite better 2023-05-06 22:45:05 +01:00
Corwin e8479c093b
add macro to import a palette from a sprite 2023-05-06 22:44:43 +01:00
Corwin 13f0eaf5b0
add more colours 2023-05-06 20:31:52 +01:00
Corwin 54340358bc
remove unused import 2023-05-06 19:44:08 +01:00
Corwin 1d7cc04cbf
more colours 2023-05-06 19:11:39 +01:00
Corwin 0271da6d43
add a no game 2023-05-06 18:50:35 +01:00
Corwin 400abe5b31
Release v0.15.0 2023-04-25 21:51:29 +01:00
Corwin 68e981f3c8
Objects, again, again (#402)
* A redesign of objects giving the option of a more managed and an
unmanaged system.
* Managed system features
    * Z ordering (should be efficient, based on a doubly linked list).
* More than 128 objects if some are disabled (not currently efficient).
* Unmanaged
    * Same sprite system as before.
    * You control how objects get put in to OAM with the unmanaged OAM.
    
TODO before this is mergable:
* [x] Docs pass, aim for everything to have docs as before.
* [x] Tests, some of these needs some run time testing.
* [x] Affine matrices, I'm not leaving this to die this time.
* [x] Some API redo, so the names make sense / are similar to before.

Future work:
* The Sprite loader should keep most recently used sprites around and
upon allocation of a new sprite try unloading the least recently used
sprite. (Performance wise this would be a disaster as it would be doing
dealloc and alloc in vblank, so really we want to "learn" how much
buffer we should maintain and try to get that during GC).

- [x] Changelog updated
2023-04-25 21:14:49 +01:00
Gwilym Inzani 9835f81b5f Maybe make the build faster by using the same settings for all crates 2023-04-25 20:22:44 +01:00
Gwilym Inzani 8e152f05c9 Ensure mod tests is at the end 2023-04-25 20:06:52 +01:00
Corwin 3ec9bd2610
Merge remote-tracking branch 'upstream/master' into new-objects 2023-04-23 20:44:46 +01:00
Corwin 94a8e2d4c3
add deprecation for old names 2023-04-23 20:41:42 +01:00
Gwilym Inzani 6355ac0df7
Extract agb hashmap (#418)
Pulls out the hashmap to its own crate. Allows us to use this in interop
code between agb and desktop code and also gives us the ability to run
miri on it to make sure we're not running into any crazy unsoundness
bugs.

- [x] Changelog updated / no changelog update needed
2023-04-23 19:25:33 +01:00