Commit graph

1237 commits

Author SHA1 Message Date
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
Corwin b75481b88e
Merge remote-tracking branch 'upstream/master' into new-objects 2023-04-23 18:56:07 +01:00
Corwin 14c7028aa0
reverse change of name 2023-04-23 18:55:23 +01:00
Gwilym Inzani d80e3f876e Extract agb hashmap to its own crate 2023-04-23 17:39:00 +01:00
Corwin da61ba78ae
remove alloc error handler 2023-04-23 12:50:15 +01:00
Corwin e26a9c2c24
Merge remote-tracking branch 'upstream/master' into new-objects 2023-04-22 00:46:41 +01:00
Corwin 7e1f996d90
correct doc test 2023-04-22 00:40:06 +01:00
Corwin 6417570a51
add docs 2023-04-21 17:14:51 +01:00
Gwilym Inzani 6575a067b5 Fix documentation compilation 2023-04-18 20:07:08 +01:00
Gwilym Inzani 293bb15c7b Don't need this any more now I'm finished debugging 2023-04-13 22:46:03 +01:00
Gwilym Inzani f53cd9b25a Write some terrible documentation 2023-04-13 22:06:06 +01:00
Gwilym Inzani eac350b391 Replace example usage with the new macro 2023-04-13 22:01:37 +01:00
Gwilym Inzani 65877b1d32 Delete this file now 2023-04-13 21:53:28 +01:00
Gwilym Inzani cb127c7924 New include_gfx macro 2023-04-13 21:53:13 +01:00
Gwilym Inzani 5f59a01c21 Use .take() rather than replace(..., None) 2023-04-12 13:49:22 +01:00
Corwin fc5ce97db4
Release v0.14.0 2023-04-11 21:28:22 +01:00
Corwin aea64e974f
change of language 2023-04-11 20:59:45 +01:00
Corwin f59e4ad322
various micro optimisations 2023-04-07 01:40:27 +01:00
Corwin 4f19d6c240
forbid slot drop and move slot on set 2023-04-06 23:34:30 +01:00
Corwin 69b1ea5e47
fix brackets 2023-04-06 21:47:21 +01:00
Corwin c608458247
start on writing docs. A long way to go... 2023-04-06 21:45:32 +01:00
Corwin c84e81299b
improve the migration 2023-04-06 21:45:32 +01:00
Corwin cdc2eed01d
unsafe arena added (may remove later) 2023-04-06 21:45:30 +01:00
Corwin e690dda0f5
add test that my ordering code is right 2023-04-06 21:45:03 +01:00
Corwin d6006c7808
rename parts of objects 2023-04-06 21:45:03 +01:00
Corwin d183b8373d
pull out where to write 2023-04-06 21:45:03 +01:00
Corwin 875d53c040
add rotation to sprite example 2023-04-06 21:45:03 +01:00
Corwin 7265576e2a
fix affine matrix copying 2023-04-06 21:45:03 +01:00
Corwin 0e9910c517
copy affine matricies at copy time 2023-04-06 21:45:03 +01:00
Corwin 354cf7addc
keep and drain affine matricies 2023-04-06 21:45:03 +01:00
Corwin 63088f2907
affine matricies! 2023-04-06 21:45:03 +01:00
Corwin 8d23af010f
remove unused import 2023-04-06 21:45:03 +01:00
Corwin 26b9a50e4e
manage sprites better 2023-04-06 21:45:03 +01:00
Corwin 63e87b046b
correctly initialise before iteration 2023-04-06 21:45:03 +01:00
Corwin e6937bbb61
be able to clear sprite 0 on drop 2023-04-06 21:45:03 +01:00
Corwin e0af614cac
correctly initialise as not visible 2023-04-06 21:45:03 +01:00
Corwin 6007b95926
deallocate palettes 2023-04-06 21:45:03 +01:00
Corwin 57f24acdf9
use drop of iterator to clear rest of objects 2023-04-06 21:45:03 +01:00
Corwin d8f0d78d4b
unsafe is unsafe 2023-04-06 21:45:03 +01:00
Corwin 82b68fc335
mark function that can be used unsafely unsafe 2023-04-06 21:45:03 +01:00
Corwin f86bf9c07a
woah there, that shouldn't be public! 2023-04-06 21:45:03 +01:00
Corwin 660adbe961
fix games 2023-04-06 21:45:00 +01:00
Corwin c03c1664cb
move static sprite loader into managed oam 2023-04-06 21:43:49 +01:00
Corwin ab082c59a1
a mad redo of how objects work 2023-04-06 21:43:49 +01:00
Corwin 686ded4377
fix doc example 2023-04-06 21:28:52 +01:00
Corwin 96a321504c
correct doc sections 2023-04-06 21:17:33 +01:00
Corwin dffda47985
resolve interrupts unsoundness 2023-04-06 21:16:13 +01:00
Corwin d3834ed2ff
allocator unsound to use in interrupt 2023-04-06 20:48:04 +01:00
Corwin 182bae100c
remove unused function 2023-04-06 19:23:55 +01:00