Commit graph

1237 commits

Author SHA1 Message Date
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
Corwin 46faff254f
add grow to block allocator 2023-04-06 19:23:42 +01:00
Corwin 7030d65d9f
extract mutable and staticable parts 2023-04-06 17:31:02 +01:00
Gwilym Inzani e07a080aad Reduce codegen units to 1 to ensure build works 2023-04-05 17:06:56 +01:00
Gwilym Inzani 9d621f9b6a Add shstrtab section for lld 2023-04-02 20:39:38 +01:00
Corwin bf79fc89fb
Update Rust crate bitflags to v2 (#395) 2023-03-23 23:11:42 +00:00
Corwin 8eac033650
derive some traits on bitflags 2023-03-23 22:47:04 +00:00
renovate[bot] 044261a2ff
Update Rust crate bitflags to v2 2023-03-23 22:28:28 +00:00
Gwilym Inzani 8a3660733d Add rustfmt as a component to rust-toolchain 2023-03-23 22:17:02 +00:00
Gwilym Inzani ec3e43da56 cargo fmt everywhere 2023-03-23 21:59:49 +00:00
Corwin 0127508061
fat lto to fix build :)
(not recommended as general strategy)
2023-03-23 21:40:20 +00:00
Corwin 76b3aecda0
workaround the rust issue
rust-lang/rust#108853
2023-03-23 20:47:15 +00:00
Gwilym Inzani 54311727ec Fix build errors 2023-02-24 08:55:02 +00:00
Gwilym Inzani 689bfc642f Check if the tiles passed are of the correct format 2023-02-24 08:47:45 +00:00
Gwilym Inzani c6bac34294 Make the number of colours a property of the background 2023-02-24 08:44:47 +00:00
Gwilym Kuiper 152f96e953 Consistently use 'gba 2023-02-23 21:22:53 +00:00
Gwilym Kuiper 92066f7adb Add lifetimes to timers 2023-02-23 20:46:28 +00:00
Gwilym Kuiper 2bab48b422 Add lifetimes to the mixer 2023-02-23 20:44:20 +00:00
Gwilym Kuiper 5ac408d414 Do all the video modes 2023-02-23 20:42:48 +00:00
Gwilym Kuiper ce5641f5ef Add correct lifetimes for Blend 2023-02-23 20:39:23 +00:00
Gwilym Kuiper 9757f7ed54 Add correct lifetimes to windows 2023-02-23 20:37:03 +00:00
Gwilym Kuiper 0eec7e366c Add lifetimes to ObjectController 2023-02-23 20:36:00 +00:00
Gwilym Kuiper b76e7b9bf0 Release v0.13.0 2023-01-19 20:21:09 +00:00
Gwilym Kuiper 1cd4cc6a9e Merge remote-tracking branch 'origin/master' into remove-option-to-manage-your-own-interrupts-in-the-mixer 2023-01-12 22:30:32 +00:00
Gwilym Kuiper 7525a6f572
Make missing a vblank interrupt wait less painful (#374)
If you missed a vblank, then the next call to wait_for_vblank would
pointlessly wait rather than returning immediately. Meaning if you
missed a vblank by a few cycles, you'd be waiting for the entire next
one :(.

- [x] Changelog updated / no changelog update needed
2023-01-12 22:24:30 +00:00
Gwilym Kuiper 43aebe4092
Fix volume zero and power of 2 (#375)
Fixes #371.

If the volume was zero, the calculation for leading zeros was incorrect.
So both reduce the amount of work done for 0 volume and also count the
leading zeros correctly in the fast path.

- [x] Changelog updated / no changelog update needed
2023-01-12 22:17:16 +00:00
Gwilym Kuiper 987d7b0d2c
Add missing methods for tiled1 to allow creating backgrounds (#368)
Fixes #367

Had missed implementations to actually get the backgrounds if you were
using tiled1 mode.

- [x] Changelog updated / no changelog update needed
2023-01-12 22:14:43 +00:00
Gwilym Kuiper 009de4e660 Update test to be more relevant 2023-01-12 22:02:07 +00:00
Gwilym Kuiper 8009ffea09 If volume is 0, don't actually play anything 2023-01-12 21:54:08 +00:00
Gwilym Kuiper 6ebe08e528 Fix out by 1 while calcuating leading zeros 2023-01-12 21:53:54 +00:00
Gwilym Kuiper 827afd87b9 Make wait_for_vblank syscall pub(crate) 2023-01-12 21:24:37 +00:00
Gwilym Kuiper e50540752c Make missing a vblank interrupt wait less painful 2023-01-12 21:20:54 +00:00
Gwilym Kuiper b50d6694d9 Add missing methods for tiled1 to allow creating backgrounds
Fixes #367
2023-01-09 11:27:25 +00:00
Corwin 4e6b4107cb and test that benchmarks the allocator 2023-01-06 18:23:42 +00:00
Gwilym Kuiper d57a1edbd4 Remove stray reference to after_vblank 2022-12-10 00:32:57 +00:00
Gwilym Kuiper 5a71db0c17 Move buffer management entirely to the mixer state 2022-12-10 00:28:30 +00:00
Gwilym Kuiper 93d0fe5700 Start refactoring towards needing &self in write_channels 2022-12-10 00:19:05 +00:00
Gwilym Kuiper a870a1deda Can set the asm buffer size just once 2022-12-10 00:01:08 +00:00
Gwilym Kuiper 6f2c1bc616 Don't need to do the mod3_estimate here too 2022-12-10 00:00:36 +00:00
Gwilym Kuiper c031e9b002 Put the MixerBuffer in IWRAM 2022-12-09 23:33:25 +00:00
Gwilym Kuiper 8efbf87c21 Get rid of references to manual interrupt work 2022-12-09 23:09:16 +00:00
Gwilym Kuiper 0f5ce17f75 Fix the examples and the games 2022-12-09 23:00:28 +00:00
Gwilym Kuiper 6df06211c6 Fix the examples 2022-12-09 22:34:16 +00:00
Gwilym Kuiper 390392a1d8 Rename timer -> fifo_timer 2022-12-09 22:28:32 +00:00
Gwilym Kuiper b74c5e39c0 Remove setup_interrupt_handler and after_vblank in the mixer 2022-12-09 22:27:04 +00:00
Gwilym Kuiper 3e8090e153 Fix clippy lint for inline format args 2022-12-09 20:36:09 +00:00
Gwilym Kuiper 99ce2f73d5
Textrender rework (#352)
This reworks the text rendering system so the tiles in some rendered
text can be persisted across frames. This is important for performance
in situations where you want to incrementally write to a text box for
example in a Pokemon/Phoenix Wright style dialogue system. Previously
the only way to do this was to render all the chars in the text every
frame, which is currently prohibitively slow (though this could be
potentially sped up).

In addition with this implementation it is easy to individually colour
each character, so I added the ability to do that to.

I expanded the tests to test keeping the renderer instance (which
contains the tiles) over multiple frames, and also added in some
coloured text.

If you are happy with this implementation then I will change the
examples which use text, and also add some more documentation. Thanks
for taking a look.
2022-11-21 23:14:40 +00:00
jem 77275e2718 add in asserts for palette indicies 2022-11-21 21:50:43 +00:00
Gwilym Kuiper 212fd32108 Remember to clear the renderer 2022-11-21 07:37:03 +00:00
Gwilym Kuiper 08ceef09cd Rename 'c to 'b 2022-11-21 07:30:33 +00:00
Gwilym Kuiper 9660b6df12 Fix the text_render example 2022-11-21 07:28:40 +00:00
Gwilym Kuiper 707c2bf7e7 Remove the 'b lifetime 2022-11-21 07:26:48 +00:00
jem fbcf001986 unneeded newlines 2022-11-20 23:17:49 +00:00
jem 8b23b7d54a wrong title 2022-11-20 23:16:23 +00:00
jem 31c4d47872 whitespace 2022-11-20 23:15:09 +00:00
jem 0f3182d5b8 fix examples 2022-11-20 19:35:03 +00:00
jem 75fe0532f1 add docs 2022-11-20 19:33:39 +00:00
jem e7d87b8eee fix clippy warnings 2022-11-19 15:57:38 +00:00
jem e576f0685e readd new line 2022-11-19 15:49:55 +00:00
jem 07dc80e8fa rework the text renderer 2022-11-19 15:44:29 +00:00
Gwilym Kuiper deb907b9eb Fix remaining spelling errors in agb 2022-11-17 21:16:40 +00:00
Gwilym Kuiper 45431615dc Fix spelling errors in hash_map 2022-11-17 21:15:48 +00:00
Gwilym Kuiper 7621f47644 fix spelling errors in sync 2022-11-17 21:15:23 +00:00
Gwilym Kuiper dce5f40c26 Fix spellings in sound 2022-11-17 21:14:38 +00:00
Gwilym Kuiper da0ea524d9 Fix spelling errors in save 2022-11-17 21:13:22 +00:00
Gwilym Kuiper 51a8ec4d95 xfer -> transfer 2022-11-17 21:12:18 +00:00
Gwilym Kuiper c8ff3b4359 blnd -> blend 2022-11-17 21:10:56 +00:00
Gwilym Kuiper aa29b52b6b PingPong is 2 words 2022-11-17 21:10:26 +00:00
Gwilym Kuiper 0d6e6c709c Fix spellings in object.rs 2022-11-17 21:10:11 +00:00
Gwilym Kuiper cc879a094e Fix spellings in blend.rs 2022-11-17 21:05:26 +00:00
Gwilym Kuiper 32a8b213fb disp -> display 2022-11-17 21:04:53 +00:00
Gwilym Kuiper 140442fe0b Fix spellings in affine.rs 2022-11-17 21:04:32 +00:00
Gwilym Kuiper b37ce0b9b6 Fix spelling errors in block_allocator 2022-11-17 21:03:32 +00:00
Gwilym Kuiper 55c7541386 backc is not a word 2022-11-17 21:00:51 +00:00
Corwin b7a6158873 remove feature not required in later nightlies 2022-11-09 00:11:35 +00:00
Gwilym Kuiper 6319fd3a20 Fix doc errors and warnings 2022-11-01 22:02:51 +00:00
Gwilym Kuiper 9c99f25a56 Spell left correctly 2022-11-01 21:25:39 +00:00
Gwilym Kuiper c57013aafd Add deny(missing_docs) to input 2022-11-01 21:25:38 +00:00
Gwilym Kuiper dfa70f4335 Add a bunch of docs for input 2022-11-01 21:15:47 +00:00
Corwin 2efddfc342 changes made to make new game 2022-10-31 19:31:54 +00:00
Corwin 70f22b9255 Release v0.12.2 2022-10-22 12:59:20 +01:00
Corwin 78f9fd2026 Release v0.12.1 2022-10-12 19:00:12 +01:00
Corwin ae419fb6c1 when building docs, don't use instruction set 2022-10-12 17:30:08 +01:00
Corwin a9faaffe46 reflow doc comments 2022-10-12 17:30:08 +01:00
Corwin ab4089f5f3 fix broken links 2022-10-12 17:30:08 +01:00
Corwin 82baaa70cb deny broken links 2022-10-12 17:30:08 +01:00
Corwin 886f604efe rustfmt 2022-10-12 17:30:08 +01:00
Gwilym Kuiper fc45af262b Release v0.12.0 2022-10-11 23:34:13 +01:00
Gwilym Kuiper f1fb9d5375 Remove pointless set_scroll_pos and scroll_pos from AffineBackground 2022-10-11 22:32:00 +01:00
Corwin e30e0b76e2
Merge pull request #324 from corwinkuiper/affine-matrix-background
Use the new Affine Matrix stuff in the affine background
2022-10-09 20:51:26 +01:00
Corwin ae8d2b2fa0 fix broken docs 2022-10-09 17:52:24 +01:00
Corwin 4dfa6c25a5 REMOVE UNUSED IMPORT THAT I JUST MADE 2022-10-09 17:27:07 +01:00
Corwin f6dd65ae52 fix test 2022-10-09 17:21:30 +01:00
Corwin 6d7bc75bbb remove another unused import (in the classic case of dev by CI) 2022-10-09 17:21:21 +01:00
Corwin fb08d7e208 remove unused import 2022-10-09 17:05:06 +01:00
Corwin 89107f7a4e correct (and much better) docs 2022-10-09 16:59:58 +01:00
Corwin ed1e8bcbdc use new affine stuff in map 2022-10-09 16:59:49 +01:00
Corwin c69fdd7bec switch to using fixed point numbers in gba representation 2022-10-09 11:41:31 +01:00
Corwin dcdf678126 completely remove scalar mul 2022-10-09 11:31:54 +01:00
Corwin 002d409db8 this is not valid because we don't track the lower right entry
for rotation and translation this remains as 1, but it should change for scaling
2022-10-09 00:56:34 +01:00
Corwin 963fbc8c23 should be a multiply 2022-10-09 00:53:48 +01:00