Commit graph

436 commits

Author SHA1 Message Date
Gwilym Kuiper f2ce19c356 Switch to non-null 2021-08-16 22:24:32 +01:00
Gwilym Kuiper a7a1cb3ecd use super::*; 2021-08-16 21:20:52 +01:00
Gwilym Kuiper c8ac436b84 Use constants rather than hard coded stuff 2021-08-16 21:20:29 +01:00
Gwilym Kuiper 81e9789272 Correctly handle OOM 2021-08-16 21:19:51 +01:00
Gwilym Kuiper 94d5a71007 Split out bump_allocator 2021-08-16 21:14:28 +01:00
Gwilym Kuiper 8a0cb86eda Assert that it is actually in ewram 2021-08-16 21:11:40 +01:00
Gwilym Kuiper cd4718f8c5 Remove the need for this to be mut and write it in a more 'rusty' way 2021-08-16 21:08:39 +01:00
Gwilym Kuiper 22c6efa5fa Have a new() method 2021-08-16 21:07:25 +01:00
Gwilym Kuiper 2bacbf35dc Extern definition can be made smaller 2021-08-16 21:04:37 +01:00
Gwilym Kuiper 7062610aba Start a basic allocator with a super simple test 2021-08-16 21:02:55 +01:00
Gwilym Kuiper 1c07268f11 Include alloc 2021-08-16 21:02:36 +01:00
Gwilym Kuiper a500c9dbb1 Make mutex new constant and reduce unsafe block size 2021-08-16 21:02:03 +01:00
Corwin Kuiper 87705514a7 Merge branch 'master' of github.com:agbrs/agb into affine-double-warning 2021-08-16 19:31:07 +01:00
Corwin Kuiper 4d45ca4203 remove warning 2021-08-16 19:31:04 +01:00
Corwin Kuiper fe9461e5c5 redraw everything if there is no overlap 2021-08-15 23:40:57 +01:00
Corwin Kuiper 631bf2bae2 add collision function 2021-08-15 23:40:25 +01:00
Gwilym Kuiper 1b40fe2b03
Merge pull request #106 from gwilymk/half-multiplications-in-sound-mixing
Halve the number multiplications in sound mixing
2021-08-15 23:36:21 +01:00
Gwilym Kuiper 5d255fddea Add asm_include.s to the rerun-if-changed in build.rs 2021-08-15 23:27:39 +01:00
Gwilym Kuiper dffd57204c Remove trailing space 2021-08-15 23:04:02 +01:00
Gwilym Kuiper a2f0c43f26 Reduce the number of registers stored and used 2021-08-15 23:00:17 +01:00
Gwilym Kuiper 1be6dfbf36 Unwind loop 4 times 2021-08-15 22:36:32 +01:00
Gwilym Kuiper 0c48975fa0 Do 2 mulitplications at once 2021-08-15 22:18:02 +01:00
Gwilym Kuiper a2da434013 Rename the directory 2021-08-15 20:39:17 +01:00
Gwilym Kuiper 4a6ef023f5 Rename agb-entry to agb-macro in cargo.tomls 2021-08-15 20:37:36 +01:00
Corwin Kuiper 2974711a38 update more 2021-08-08 00:01:58 +01:00
Corwin Kuiper 7708ccc4e1 remove unused import 2021-08-07 23:51:07 +01:00
Corwin Kuiper 36c6ab1914 correct the commit routine 2021-08-07 23:50:28 +01:00
Corwin Kuiper 0ccde7d328 satisfy linter 2021-08-07 18:41:28 +01:00
Corwin Kuiper 724147ecfa commit step required now 2021-08-07 18:20:08 +01:00
Corwin Kuiper 7798f4c95f nicer way of using mutable backing storages 2021-08-07 18:15:46 +01:00
Corwin Kuiper d6b388e1d6 simplify the generics 2021-08-07 18:14:41 +01:00
Corwin Kuiper 6652bdbd70 make to generics 2021-08-07 18:14:05 +01:00
Corwin Kuiper e176e986ad part way implementation of background 2021-08-07 18:14:02 +01:00
Corwin Kuiper f9014a0bf9 started work on new background implementation 2021-08-07 18:12:49 +01:00
Gwilym Kuiper 503b7262ca May as well call this version 0.1 2021-08-07 16:45:08 +01:00
Gwilym Kuiper 739f81dd30 rename agb-entrypoint to agb-entry 2021-08-07 16:40:09 +01:00
Gwilym Kuiper 861ecc626a Use the new entrypoint macro in all the examples 2021-08-07 16:37:32 +01:00
Gwilym Kuiper d2a4d0d1c3 Export the new macro in agb 2021-08-07 16:33:17 +01:00
Gwilym Kuiper c59f063b2b Rename crate with an _ to be consistent with the image converter 2021-08-07 16:33:17 +01:00
Corwin Kuiper ff51341679 print in interrupt 2021-08-07 14:16:41 +01:00
Corwin Kuiper 477b0465fb add docs for vblank interrupt 2021-08-07 14:14:06 +01:00
Corwin Kuiper fa250cee60 remove allow warning 2021-08-07 14:14:06 +01:00
Corwin Kuiper b559b0eb54 add some docs 2021-08-07 14:14:06 +01:00
Corwin Kuiper c60eaaaff0 doesn't need to be public 2021-08-07 14:14:06 +01:00
Corwin Kuiper 5093884612 move enable and disable to impl 2021-08-07 14:14:06 +01:00
Corwin Kuiper 476b030b41 rename wait for vblank functions 2021-08-07 14:14:06 +01:00
Corwin Kuiper 99f992353a fix wave example 2021-08-07 14:14:06 +01:00
Corwin Kuiper da6ff40a32 add docs 2021-08-07 14:14:06 +01:00
Corwin Kuiper 1b971b8993 add lock with key 2021-08-07 14:14:06 +01:00
Corwin Kuiper 00a5b2487c change to using extern in linker 2021-08-07 14:14:06 +01:00
Corwin Kuiper 013522f642 setting lto to thin works? 2021-08-07 14:14:06 +01:00
Corwin Kuiper 4467d0cf18 fix incorrect label from rebase 2021-08-07 14:14:06 +01:00
Corwin Kuiper 3b26c0b262 acknowledge requests after handling them 2021-08-07 14:14:06 +01:00
Corwin Kuiper 7b46bc9703 change name to "get" 2021-08-07 14:14:04 +01:00
Corwin Kuiper 37c29b7ec3 should enable interrupts by writing a 1 2021-08-07 14:13:23 +01:00
Corwin Kuiper 47f8ee5b70 satisfy linter 2021-08-07 14:13:20 +01:00
Corwin Kuiper f8fb6ba7b4 change implementation of vblank to use new interrupt handler
also fixes all examples
2021-08-07 14:12:00 +01:00
Corwin Kuiper 7b05da4783 change name of interrupt handler
it is no longer simple
2021-08-07 14:12:00 +01:00
Corwin Kuiper 007d4d3ff8 handler does not need to be public to be exposed 2021-08-07 14:12:00 +01:00
Corwin Kuiper f1a2b76d28 arm is callee save 2021-08-07 14:12:00 +01:00
Corwin Kuiper e22564a29c disable interrupts during handler 2021-08-07 14:12:00 +01:00
Corwin Kuiper 9bab2a75d0 add macro for much easier interrupt handler adding 2021-08-07 14:12:00 +01:00
Corwin Kuiper 8b8b2b17a2 change to using iter 2021-08-07 14:12:00 +01:00
Corwin Kuiper 1ac33bfbc8 put interrupt handler in iwram, 32 bit bus 2021-08-07 14:12:00 +01:00
Corwin Kuiper bd1f5f6a5a store gbatek recommended registers 2021-08-07 14:12:00 +01:00
Corwin Kuiper ac5fd06106 add test for length of interrupt table 2021-08-07 14:12:00 +01:00
Corwin Kuiper d607f892e3 change to array for efficient lookup table 2021-08-07 14:12:00 +01:00
Corwin Kuiper a959e8e06b don't use register 4 2021-08-07 14:12:00 +01:00
Corwin Kuiper 47b02d29cf correct which way round locked and unlocked is 2021-08-07 14:12:00 +01:00
Corwin Kuiper 1318e7eca4 ensure mutex is unlocked before locking 2021-08-07 14:12:00 +01:00
Corwin Kuiper a9aad11dd7 make interrupt system interrupt safe(r)
FnMut is not something that can be used in a interrupt safe manner.
Instead use Fn with a Mutex that disables interrupts with a lock.
2021-08-07 14:12:00 +01:00
Corwin Kuiper a5488fab56 review of documentation suggests that this does nothing 2021-08-07 14:12:00 +01:00
Corwin Kuiper f54a539296 use better calling convention 2021-08-07 14:12:00 +01:00
Corwin Kuiper 086a4385be correct comments to accurately reflect what is going on 2021-08-07 14:12:00 +01:00
Corwin Kuiper 466d0844c5 push all registers, as rust may be using them 2021-08-07 14:12:00 +01:00
Corwin Kuiper 597b9370fc don't disable and reenable interrupts 2021-08-07 14:12:00 +01:00
Corwin Kuiper b98e6cbb02 add all other interrupts 2021-08-07 14:12:00 +01:00
Corwin Kuiper 30c5a0eea9 export interrupt module 2021-08-07 14:12:00 +01:00
Corwin Kuiper c2d4c99f66 correct exportation of functions 2021-08-07 14:12:00 +01:00
Corwin Kuiper 2ff9644310 disable interrupts during the interrupt handler 2021-08-07 14:12:00 +01:00
Corwin Kuiper dacdf51dca remove unused debug counter 2021-08-07 14:12:00 +01:00
Corwin Kuiper ebfd637300 satisfy linter by removing elidable lifetime 2021-08-07 14:12:00 +01:00
Corwin Kuiper 2cc0bee7c3 example first version of an interrupt handler implemented with closures 2021-08-07 14:12:00 +01:00
Corwin Kuiper 42647b7373 add println macro for mgba 2021-08-07 13:21:54 +01:00
Gwilym Kuiper c265a95996 Release agb v0.6.0 2021-08-01 21:50:18 +01:00
Gwilym Kuiper 7229e9012d Update agb's agb-image-converter to 0.6.0 2021-08-01 21:46:08 +01:00
Gwilym Kuiper de360f5dbc
Merge pull request #95 from gwilymk/attempt-speedup-mixer-in-asm
Speed up the mixer by writing the core loops in ASM
2021-08-01 21:35:07 +01:00
Gwilym Kuiper ac8e2dfe9d Go back to the other way of addressing as they aren't equivalent 2021-08-01 21:29:44 +01:00
Gwilym Kuiper ec65b18fd2 Make the str consistent with the ldr 2021-08-01 21:23:31 +01:00
Gwilym Kuiper 809d3f52ee update the comment about what's kept between iterations 2021-08-01 21:01:59 +01:00
Gwilym Kuiper cce3ecdde5 Use r9 rather than lr 2021-08-01 21:00:49 +01:00
Gwilym Kuiper 2db696f8bf reuse r4 2021-08-01 20:59:01 +01:00
Gwilym Kuiper 18d96e4349 Update comments now I understand what's happening 2021-08-01 20:50:52 +01:00
Gwilym Kuiper 451f38604d Add an explicit .pool at the end of the mixer 2021-08-01 20:45:57 +01:00
Gwilym Kuiper d1c312ab79 Remove loads of whitespace 2021-08-01 20:44:37 +01:00
Gwilym Kuiper 09ad082f3f Furter rearranging for more sense making 2021-08-01 20:41:56 +01:00
Gwilym Kuiper 80e03073fd Reorder the asm instructions to make better sense 2021-08-01 20:29:45 +01:00
Gwilym Kuiper 1af53aacb4 Done check makes sense to go at the end 2021-08-01 20:23:39 +01:00
Gwilym Kuiper cc99aad4c5 Move the comments to a nicer place in the file 2021-08-01 20:23:05 +01:00
Gwilym Kuiper 5bc3844a14
Merge pull request #92 from gwilymk/proc-macro-for-agb-image-converter
Proc macro for agb image converter
2021-08-01 20:07:17 +01:00
Gwilym Kuiper 9f259fdc0a Make clippy happy by using .add rather than .offset 2021-07-31 23:18:26 +01:00
Gwilym Kuiper f1b6b1035b Reduce mixer_collapse by 1 instruction 2021-07-31 22:01:20 +01:00
Gwilym Kuiper 8cffa4ae3d Better comparison 2021-07-31 22:00:41 +01:00
Gwilym Kuiper f5d771d349 Use asm for the tight loops in the sound mixer 2021-07-31 21:47:05 +01:00
Gwilym Kuiper e3510a73f7 Re-export the image converter macro 2021-07-26 23:42:28 +01:00
Gwilym Kuiper d7a24d9659 Start switching to the quote crate for generating the code 2021-07-22 19:03:49 +01:00
Gwilym Kuiper 19e0a0527b Use syn crate rather than litrs 2021-07-22 18:43:27 +01:00
Gwilym Kuiper 21a11a4e41 Run rustfmt on modified files in agb 2021-07-21 22:48:23 +01:00
Gwilym Kuiper 8466e9eaa4 Remove usage of typed_builder 2021-07-21 22:15:46 +01:00
Gwilym Kuiper 8713f514be Switch to a proc macro for generating the image data 2021-07-21 22:07:29 +01:00
Gwilym Kuiper 53952d8e34 Add support for reading config data from a toml file 2021-07-21 20:59:25 +01:00
Gwilym Kuiper 383c5454ea Start work for new proc macro by generating a TileData 2021-07-21 20:27:04 +01:00
Gwilym Kuiper 4a9f98e09c Allow agb-image-converter from the path 2021-07-21 20:26:38 +01:00
Gwilym Kuiper 3468fbb761 Add myself as an author for agb 2021-07-21 19:36:24 +01:00
Corwin 97cbc8c9a6
Merge pull request #90 from gwilymk/multiboot-support
Multiboot support
2021-07-19 17:53:01 +01:00
Corwin b0afeade99
Merge pull request #86 from agbrs/mgba-test-runner-cycles
Mgba test runner cycles
2021-07-13 22:30:05 +01:00
Corwin Kuiper c722c99f9e set cpu targets for asm and rust 2021-07-13 19:17:08 +01:00
Corwin Kuiper 220ddac280 use different optimisation settings 2021-07-03 22:19:02 +01:00
Corwin Kuiper 744c7a8bb4 get cycles 2021-07-03 22:18:53 +01:00
Corwin Kuiper e32a086122 Release agb v0.5.0 2021-07-03 15:51:13 +01:00
Gwilym Kuiper 7e3b983e80 Reduce duplication in crt0.s
Couldn't move the interrupt setup though :/. Not sure why
2021-06-26 23:00:10 +01:00
Gwilym Kuiper d2cad77eb9 Add multiboot support 2021-06-26 22:25:27 +01:00
Gwilym Kuiper 0b5d6f7978 Add a method to stop a playing sound 2021-06-25 22:26:00 +01:00
Gwilym Kuiper bd15a87c4d Ensure you don't hand over an already done channel 2021-06-25 22:20:18 +01:00
Gwilym Kuiper 025f4f5a91 Fix clippy lints by removing lifetimes 2021-06-25 22:18:40 +01:00
Gwilym Kuiper 90551b0ba1 Calculate the panning differently to ensure left and right ears get same amounts 2021-06-25 22:12:03 +01:00
Gwilym Kuiper 290d546248 Add lowering the volume to the example 2021-06-25 22:01:50 +01:00
Gwilym Kuiper 3c0d881a45 Allow for volume control 2021-06-25 21:57:24 +01:00
Gwilym Kuiper c81d73f8d5 Don't panic if the song has finished 2021-06-25 21:54:12 +01:00
Gwilym Kuiper 773729de98 Update example to allow you to change where the sound is coming from 2021-06-25 21:53:42 +01:00
Gwilym Kuiper 80ce5173e1 Provide a way to get the channel again 2021-06-25 21:41:35 +01:00
Gwilym Kuiper 27a470c648 Return a way to get back at the channel 2021-06-25 21:38:10 +01:00
Gwilym Kuiper 754abd58bd Return an indication as to what the sound ID is 2021-06-25 21:31:17 +01:00
Gwilym Kuiper 2409cd5538 Remove .high_priority() 2021-06-25 21:29:37 +01:00
Gwilym Kuiper 45b8480a35 Allow mutation of the SoundChannel 2021-06-25 21:27:46 +01:00
Corwin Kuiper 1b3358345e fix by showing object 2021-06-24 20:10:05 +01:00
Corwin e6a1dbae12
Merge pull request #82 from corwinkuiper/renovate/bitflags-1.x
Update Rust crate bitflags to 1.2
2021-06-21 01:18:59 +01:00
Renovate Bot 6681897494
Update Rust crate bitflags to 1.2 2021-06-21 00:13:32 +00:00
Renovate Bot d06b3518fa
Update Rust crate agb_image_converter to 0.4.0 2021-06-21 00:02:36 +00:00
Corwin Kuiper 5a00e735e9 Release agb v0.4.1 2021-06-21 00:00:27 +01:00
Corwin Kuiper d48eab29a8 Release agb v0.4.0 2021-06-20 23:55:41 +01:00
Gwilym Kuiper 574e91df2f Add sound priorities 2021-06-20 21:59:34 +01:00
Corwin 53cf1a5064
Merge pull request #67 from gwilymk/more-exciting-mixer
More exciting mixer
2021-06-20 21:49:39 +01:00
Gwilym Kuiper db4233ccee Rename mixer.rs to sw_mixer.rs 2021-06-20 21:29:44 +01:00
Corwin Kuiper ece5595d18 bump to 0.3.1 2021-06-20 21:06:57 +01:00
Corwin Kuiper 3546ce9ca4 implement clone and copy 2021-06-20 21:05:50 +01:00
Gwilym Kuiper 057467ecf8 Only do the if statement once per channel rather than once per index 2021-06-18 22:56:49 +01:00
Gwilym Kuiper ea9441f40b Don't need to go through archive.org 2021-06-18 22:29:31 +01:00
Gwilym Kuiper 11a74979eb Fix unaligned write 2021-06-18 22:29:31 +01:00
Gwilym Kuiper e88eb16c62 Calculate panning correctly 2021-06-18 22:29:31 +01:00