Commit graph

1076 commits

Author SHA1 Message Date
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