Commit graph

1385 commits

Author SHA1 Message Date
Gwilym Kuiper 4c63058ba0 Fix example 2022-07-12 13:42:30 +01:00
Gwilym Kuiper 86b9c2b3dd Deny missing docs in mixer 2022-07-12 13:33:32 +01:00
Gwilym Kuiper 2c7db427f8 Document sw_mixer 2022-07-12 13:32:35 +01:00
Gwilym Kuiper d78d9155bf Allow impl Into<Num<...>> to make it a bit simpler 2022-07-12 12:53:17 +01:00
Gwilym Kuiper ead344ca0b Document the whole of mixer/mod.rs 2022-07-12 12:50:40 +01:00
Gwilym Kuiper d3c8480ce0 Write some docs for the mixer 2022-07-12 12:29:35 +01:00
Gwilym Kuiper 3f1f290791 Bring memset.s in line with latest agbabi 2022-06-24 21:19:52 +01:00
Gwilym Kuiper fcbaacac1b Update to the latest agbabi memcpy 2022-06-24 21:12:14 +01:00
Gwilym Kuiper e08aaf6c7a Reduce input and output offsets to 0..8 to half run time 2022-06-22 23:40:41 +01:00
Gwilym Kuiper d053aa1707 Add a test for the non-word case 2022-06-22 23:38:36 +01:00
Gwilym Kuiper 6aa30462f9 Replace memcpy tests with a test which does all offsets for lots of sizes
Found a bug in agbabi with size 0, source offset 1, target offset 3
2022-06-22 23:31:23 +01:00
Gwilym Kuiper 16efca4b59 Add some tests for memset4 2022-06-22 22:33:56 +01:00
Gwilym Kuiper cb5763ed53 Check sizes 0..80 in size with 0..10 offset for memset 2022-06-22 22:00:26 +01:00
Corwin 10eeeaf9e7 a test for agbabi memset 2022-06-21 02:00:29 +01:00
Gwilym Kuiper 5ca8cb8bf7 Use agbabi's fix for small copies / sets 2022-06-19 17:38:34 +01:00
Gwilym Kuiper c9f1401ef3 Fix issue with small, misaligned copies 2022-06-19 13:03:44 +01:00
Gwilym Kuiper a7d52bbed0 Add offset tests and failing test for both offetted by 1 byte 2022-06-19 12:24:55 +01:00
Gwilym Kuiper 39bef8f866 Add some basic agbabi tests for memcpy 2022-06-19 12:17:34 +01:00
Gwilym Kuiper 578b1eefa4 Delete decompile accidentally committed 2022-06-17 22:40:31 +01:00
Gwilym Kuiper 64fbf13cc3 Update gba_mb with the new requried references 2022-06-17 00:48:32 +01:00
Gwilym Kuiper cb48325f21 Add README for agbabi 2022-06-17 00:40:17 +01:00
Gwilym Kuiper 4ac3939e9a Add agbabi licence 2022-06-17 00:38:12 +01:00
Gwilym Kuiper 7e46cf6a1d Remove the hack from the mixer 2022-06-17 00:32:07 +01:00
Gwilym Kuiper 8a8e8c011b Make sure to reference the agbabi files so they are included 2022-06-17 00:30:33 +01:00
Gwilym Kuiper 2d90755090 Put everything in different sections 2022-06-17 00:30:33 +01:00
Gwilym Kuiper 601360ca67 Compile agbabi into agb 2022-06-17 00:30:33 +01:00
Gwilym Kuiper 149d2ec76b Delete the archive file each time we run the build 2022-06-17 00:30:33 +01:00
Corwin c5af151d76
Merge pull request #237 from corwinkuiper/split-asm
Split asm
2022-06-17 00:24:44 +01:00
Corwin 13df836b91 update multiboot linker 2022-06-16 23:38:07 +01:00
Gwilym Kuiper 90b5e39b42 Switch to using a single archive 2022-06-16 23:32:28 +01:00
Corwin 05adfabca8 get it working 2022-06-16 23:22:27 +01:00
Corwin 0be9da755c split out assembly 2022-06-16 22:58:22 +01:00
Gwilym Kuiper fbff538d92
Merge pull request #236 from gwilymk/document-tiled-mode
Add some doc comments to tiled mode
2022-06-16 22:58:03 +01:00
Gwilym Kuiper efeaeeac4d Finish off the comments in InfiniteScrolledMap 2022-06-16 22:42:16 +01:00
Gwilym Kuiper de965e966f Write some doc comments for InfiniteScrolledMap 2022-06-16 22:30:52 +01:00
Gwilym Kuiper bc1bf3416c Add some doc comments around the video struct 2022-06-16 22:30:26 +01:00
Gwilym Kuiper 21b8f12c03 Make the 32768Hz example print the timing to the gba screen 2022-06-16 21:36:48 +01:00
Gwilym Kuiper 9eb087ad60 Print the CPU usage for the stereo sound example 2022-06-16 21:32:16 +01:00
Gwilym Kuiper 24749ac645 Do the zeroing of the buffer in assembly 2022-06-12 17:53:39 +01:00
Gwilym Kuiper 33c948208a Don't actually need to clear the buffer 2022-06-12 17:30:01 +01:00
Gwilym Kuiper 2ace226db8 Extract a function to do the clearing of the buffer 2022-06-12 17:26:16 +01:00
Gwilym Kuiper 4969672c73 Use hand written fast fill to save a few more cycles 2022-06-12 16:53:46 +01:00
Gwilym Kuiper bec1a17cfd This doesn't need the allow 2022-06-12 13:57:16 +01:00
Gwilym Kuiper bbad55af65 Deny the stricter lints 2022-06-11 20:57:40 +01:00
Gwilym Kuiper 9759555e42 Remove cast_lossless because it isn't supported by bitfield 2022-06-11 20:56:48 +01:00
Gwilym Kuiper ba35b85c81 Final clippy lint fixes 2022-06-11 20:56:05 +01:00
Gwilym Kuiper bf9f298972 Fix some sound related lints 2022-06-11 20:51:41 +01:00
Gwilym Kuiper 062e8c8881 Fix some more linter errors 2022-06-11 20:48:18 +01:00
Gwilym Kuiper 1b393cd612 Fix new clippy lints in tiled 2022-06-11 20:40:12 +01:00
Gwilym Kuiper f2e565f512 Take advantage of the fact that CriticalSection is Copy 2022-06-11 20:34:19 +01:00
Gwilym Kuiper 1edd7f4166 Add a bunch of new clippy lints 2022-06-11 20:27:08 +01:00
Gwilym Kuiper b8cf5090cb Make clippy warnings and let CI fail if there are issues 2022-06-11 20:17:37 +01:00
Gwilym Kuiper e6f5494242 Use the syscall to do the memset because the default implementation is really slow 2022-06-11 17:22:29 +01:00
Gwilym Kuiper 4633fe7e3c Set sound bias (which seems to make this work on hardware) 2022-06-11 16:53:39 +01:00
Gwilym Kuiper 3a419b05de Improve timer API and use it 2022-06-11 16:44:29 +01:00
Gwilym Kuiper d65fd5d740 Don't require the 32kHz frequency for interrupts 2022-06-11 16:22:28 +01:00
Gwilym Kuiper 3bd85c7d7c Get correct song name 2022-06-11 16:11:18 +01:00
Gwilym Kuiper 879a4f5270 Unroll the loop a bit 2022-06-11 16:10:58 +01:00
Gwilym Kuiper 5f7a1007a2 Triple buffer the sound to avoid skipping 2022-06-11 16:08:00 +01:00
Gwilym Kuiper 7d8890b03e 32768 example 2022-06-11 15:46:10 +01:00
Gwilym Kuiper a4c696ad33 Build a special version of 'frame' for freq32768 2022-06-11 13:23:39 +01:00
Gwilym Kuiper c709455e3d Add defines for freq32768 2022-06-11 13:19:56 +01:00
Gwilym Kuiper 42d3455abf Avoid duplicating the feature flag definition 2022-06-11 13:19:52 +01:00
Gwilym Kuiper 73d6dc448f Add new frequency option 2022-06-11 13:05:30 +01:00
Gwilym Kuiper 0a9a3fdf1d Remove timer field to mixer 2022-06-11 12:57:59 +01:00
Gwilym Kuiper b7bc27403e Remove pointless 'a 2022-05-12 20:28:10 +01:00
Gwilym Kuiper 93ed4b87e8
Merge pull request #226 from gwilymk/another-audio-performance-improvement
Another audio performance improvement
2022-05-04 21:05:55 +01:00
Gwilym Kuiper 4d2ad8859b Add a comment explaining the improvement 2022-05-04 20:56:39 +01:00
Gwilym Kuiper 4a06acba6b Allow volumes to be a lot higher and check that clipping is handled 2022-05-04 20:42:32 +01:00
Gwilym Kuiper abfbf6a454 Use the renamed register names 2022-05-04 20:36:06 +01:00
Gwilym Kuiper 0ec3c499cb Just use range push and pop 2022-05-04 20:27:41 +01:00
Gwilym Kuiper a0b28176c6 Use .rept rather than defining a macro 2022-05-04 20:25:55 +01:00
Gwilym Kuiper 863abe1d42 Only load SWAP_SIGN once 2022-05-04 18:08:15 +01:00
Gwilym Kuiper 8ec839f181 Be more consistent with instruction use 2022-05-04 18:07:01 +01:00
Gwilym Kuiper b02cdd9233 Calculate 127 + sample earlier 2022-05-04 18:06:11 +01:00
Gwilym Kuiper 3fea9aada0 Somehow reduce clamp_s8 by 1 instruction 2022-05-04 17:58:24 +01:00
Gwilym Kuiper 0229b95d7c Move macro definition 2022-05-04 16:59:17 +01:00
Gwilym Kuiper 73b8530240 Reduce register usage 2022-05-04 16:58:46 +01:00
Gwilym Kuiper 3b9909ad5b Add comment about how silly the implementation of gba_offset is 2022-05-03 23:43:08 +01:00
Gwilym Kuiper 2853d34b30 Correctly render different sized backgrounds and make HTTW have
pointlessly different sized backgrounds to test it properly
2022-05-03 23:42:11 +01:00
Gwilym Kuiper 5211781429 Rename rem_euclid functions 2022-05-03 23:23:55 +01:00
Gwilym Kuiper be650779e6 Correctly allocate screenblocks 2022-05-03 23:23:25 +01:00
Gwilym Kuiper ae65af4ca2 Make rem_euclid_* return a u16 2022-05-03 23:03:23 +01:00
Gwilym Kuiper 817e1e305e Add rem_euclid_*_px for pixel calculations 2022-05-03 23:00:31 +01:00
Gwilym Kuiper 4d3d2acd3b This should always be 32 2022-05-03 22:55:50 +01:00
Gwilym Kuiper 5513c8566f Replace calls to rem_euclid with unknown denominator with simple & 2022-05-03 22:46:01 +01:00
Gwilym Kuiper fae71bfbca Fix all the examples 2022-05-03 22:29:51 +01:00
Gwilym Kuiper 4f2eddb367 Actually set the correct flag 2022-05-03 21:51:00 +01:00
Gwilym Kuiper cc57dcf649 Fix compile errors 2022-05-03 21:48:08 +01:00
Gwilym Kuiper 384a5bc887 Remove a bunch of hard coded widths and heights 2022-05-03 21:46:32 +01:00
Gwilym Kuiper d514aafad4 Pass through the size 2022-05-03 21:34:41 +01:00
Gwilym Kuiper 5dd0c61808 Derive normal stuff on an enum 2022-05-03 21:30:32 +01:00
Gwilym Kuiper 288fa0c85e Add an enum for tracking background size of regular tiles 2022-05-03 21:28:32 +01:00
Gwilym Kuiper 06f701af75
Merge pull request #224 from gwilymk/print-warnings-for-assembler
Print warnings for assembler
2022-04-26 22:27:31 +01:00
Gwilym Kuiper 94f66f74b1 Fix warning in assembly 2022-04-26 22:16:56 +01:00
Gwilym Kuiper c3bfe83f6b Collect warnings to print them 2022-04-26 22:15:32 +01:00
Gwilym Kuiper 0761132779 Range of a signed byte is -128 - 127... 2022-04-26 21:22:50 +01:00
Gwilym Kuiper 921e2e9adf Calculate 32-bits at a time, since we're storing into IWRAM 2022-04-26 21:17:07 +01:00
Gwilym Kuiper 245cafa599 Calculate 2 samples per loop 2022-04-26 21:08:22 +01:00
Gwilym Kuiper 260f664c36 Extract to macro 2022-04-26 21:04:33 +01:00
Gwilym Kuiper 61ed2b905d Allow warnings when developing, but still fail CI 2022-04-24 17:07:43 +01:00
Gwilym Kuiper 563138937e Fix set_background_palette (not sure why dma wasn't working) 2022-04-23 23:26:47 +01:00
Gwilym Kuiper 178db91072 Add gc step for tiles 2022-04-23 23:03:02 +01:00
Gwilym Kuiper 7688316034 Add a gc step in commit 2022-04-23 22:58:25 +01:00
Gwilym Kuiper a562a4f600 Print frame which shows issue 2022-04-23 22:48:05 +01:00
Gwilym Kuiper 85c3287680 Run clippy on examples and tests 2022-04-23 21:03:37 +01:00
Gwilym Kuiper 1593c0e8b6 Move clippy deny to config.toml and fix warnings 2022-04-23 17:10:29 +01:00
Gwilym Kuiper a32bb2125b Remove deny clippy::all from lib.rs to ensure it always builds for users 2022-04-23 16:26:42 +01:00
Gwilym Kuiper fb197d3e79 Store font data more compressed 2022-04-23 15:42:08 +01:00
Gwilym Kuiper 1b71ef6473 Add test for font output 2022-04-23 15:33:57 +01:00
Gwilym Kuiper 6485cc895a Extract method 2022-04-23 14:34:34 +01:00
Gwilym Kuiper fec4015978 Remove hash map lookup for every pixel rendered 2022-04-23 14:30:46 +01:00
Gwilym Kuiper 6d0f95c21b
Merge pull request #214 from gwilymk/random-number-generator
Random number generator
2022-04-11 22:20:16 +01:00
Gwilym Kuiper dc62ba4467 Rename rng::next to rng::gen 2022-04-11 22:07:31 +01:00
Gwilym Kuiper f304412053 Use unsigned_abs to satisfy clippy 2022-04-11 21:15:17 +01:00
Gwilym Kuiper d56e4d5888 Correctly remove dynamic tiles if not committing a text renderer 2022-04-07 23:07:58 +01:00
Gwilym Kuiper dc4ccee451 Add a commit method for text_render 2022-04-07 23:01:01 +01:00
Gwilym Kuiper 5701667f53 Avoid overwriting text on the line above 2022-04-07 22:56:28 +01:00
Corwin f7ef25f3f0
Merge pull request #209 from corwinkuiper/z-ordered-sprites
Z ordered sprites
2022-04-07 22:46:26 +01:00
Corwin 859029a7a9 delete sprites during commit 2022-04-06 23:55:13 +01:00
Gwilym Kuiper 82c5ebf426 Use a core::fmt::Write instead 2022-04-06 21:13:57 +01:00
Gwilym Kuiper a0013096cc Remove argument 2022-04-05 23:43:35 +01:00
Gwilym Kuiper f3c467c2f1 set_background_palette seems inconsistent between release and debug mode :/ 2022-04-05 23:39:06 +01:00
Gwilym Kuiper 45e18d5cc7 Use a better example font which isn't monospace 2022-04-05 23:35:18 +01:00
Gwilym Kuiper 5c24e4089a Minimise generated dynamic tiles by using a hashmap 2022-04-05 23:11:32 +01:00
Gwilym Kuiper 22f89ed9e2 Return the bounding box 2022-04-05 23:03:56 +01:00
Gwilym Kuiper 1f65f94ee3 Support rendering multiple lines 2022-04-05 23:03:10 +01:00
Gwilym Kuiper 8a1a433f99 Replace returning number of lines printed to x width 2022-04-05 22:49:34 +01:00
Gwilym Kuiper 6bea61bb7a Update the dynamic tiles example 2022-04-05 22:48:03 +01:00
Gwilym Kuiper 2c2931fa97 Handle the height of letters correctly 2022-04-05 22:44:32 +01:00
Gwilym Kuiper e7e35f8ad8 Take xmin into account 2022-04-05 22:35:45 +01:00
Gwilym Kuiper a6f5cc9ec1 Render some text 2022-04-05 22:32:11 +01:00
Corwin 845076d0b4 add a test exploring some usage 2022-04-05 21:30:38 +01:00
Corwin 454bb872c9 resolve some unsoundness 2022-04-04 23:02:06 +01:00
Gwilym Kuiper c3a64690cd
Merge pull request #207 from gwilymk/dynamic-tileset
Add a slightly crappy dynamic tiles API
2022-04-04 20:41:16 +01:00
Corwin a4979ac847 better handling of sprites 2022-04-04 20:29:00 +01:00
Corwin 3e3039a7f6 update games 2022-04-03 21:20:20 +01:00
Corwin 2ef1dd0bf2 z ordering moving to a global controller state 2022-04-03 21:20:13 +01:00
Corwin a73e27dc7e pull out reference to a global static
this is very unsafe, but saves quite a bit of memory.
2022-04-03 18:15:31 +01:00
Gwilym Kuiper 3fd0b53350
Merge pull request #206 from corwinkuiper/send-sync
add send sync requirement
2022-04-01 00:01:09 +01:00
Gwilym Kuiper 441c839ba7 Add a slightly crappy dynamic tiles API 2022-03-31 23:58:28 +01:00
Corwin f05791b5dc add send sync requirement 2022-03-31 22:59:23 +01:00
Gwilym Kuiper f6ae4f731b Release agb v0.9.2 2022-03-28 22:50:36 +01:00
Gwilym Kuiper 394c02f704 Release agb v0.9.1 2022-03-28 22:44:33 +01:00
Gwilym Kuiper a97dcb2d2e Release agb v0.9.0 2022-03-28 22:33:22 +01:00
Gwilym Kuiper 8eb4b99045 Release agb-fixnum v0.2.1 2022-03-28 22:30:51 +01:00
Gwilym Kuiper 021fdda997 Release agb-fixnum v0.2.0 2022-03-28 22:27:19 +01:00
Gwilym Kuiper c1cfb9910a Release agb-sound-converter v0.2.0 2022-03-28 22:24:07 +01:00
Gwilym Kuiper 78dc3ac57f Release agb-image-converter v0.7.0 2022-03-28 22:21:45 +01:00
Gwilym Kuiper 942da6ebf7 Release agb-macros v0.2.0 2022-03-28 22:18:22 +01:00
Gwilym Kuiper 770ebe508b
Merge pull request #204 from gwilymk/remove-enable-sprites-in-background
Don't need to enable objects in tiled background any more
2022-03-28 22:06:07 +01:00
Gwilym Kuiper 14cd1e52c4 Make the screen visible when enabling a tiled mode 2022-03-28 21:53:54 +01:00
Gwilym Kuiper d055cbd59c Don't need to enable objects in tiled background any more 2022-03-28 21:43:53 +01:00
Gwilym Kuiper 93e14ec961 Extract out a struct for tile with reference count 2022-03-28 21:34:31 +01:00
Gwilym Kuiper d15f582aba Simplify type 2022-03-28 21:27:40 +01:00
Gwilym Kuiper 003c0d7e1a Update the games to use the new method 2022-03-28 21:21:06 +01:00
Gwilym Kuiper 16ea04d012 Remove tile set ref in agb 2022-03-28 20:53:05 +01:00
Gwilym Kuiper 9e8318cdf9 Rearrange methods to make a bit more sense 2022-03-27 21:38:12 +01:00
Gwilym Kuiper c1cbb442a1 Also use the new method in add_tile 2022-03-27 21:37:49 +01:00
Gwilym Kuiper 4b8f41140e Extract method for copying a tile to location 2022-03-27 21:37:14 +01:00
Gwilym Kuiper d2dceeb656 Add super simple animated tiles 2022-03-27 21:32:37 +01:00
Gwilym Kuiper 15e441b087 Remove the division on every insert operation 2022-03-24 18:31:18 +00:00
Gwilym Kuiper a57043604d Add some tests for the rng 2022-03-23 22:05:41 +00:00
Gwilym Kuiper 3c52f6940b Add new_with_seed method 2022-03-23 21:53:09 +00:00
Gwilym Kuiper 610722a1bf Extract the random number generator 2022-03-23 21:52:37 +00:00
Gwilym Kuiper 9752377a15 Move the random number generator to a crate level thing 2022-03-23 21:46:59 +00:00
Gwilym Kuiper ca57b61525 Remove fere_affine_matricies for now 2022-03-23 20:44:28 +00:00
Gwilym Kuiper 1f053c987a Fix warnings in chicken.rs 2022-03-23 20:43:38 +00:00
Gwilym Kuiper b44b42de1d Remove unused num_tiles method 2022-03-23 20:42:51 +00:00
Gwilym Kuiper 13de08dce7 cargo fix 2022-03-23 20:42:31 +00:00
Gwilym Kuiper 631bbed5c7 Rename get_data_end to data_end 2022-03-23 20:42:01 +00:00
Gwilym Kuiper 81853c6c99 Rename get_colour to colour 2022-03-23 20:41:24 +00:00
Gwilym Kuiper 123e8caaa4 Remove unused get_palette method 2022-03-23 20:40:15 +00:00
Gwilym Kuiper 77eba9b637 Remove get_ prefix in program_counter_before_interrupt 2022-03-23 20:39:41 +00:00
Gwilym Kuiper f1fd5859f3 Rename a few methods in object.rs to remove get_ prefix 2022-03-23 20:37:59 +00:00
Gwilym Kuiper 1f28499efb Rename get_as_bits to remove get_ prefix 2022-03-23 20:37:00 +00:00
Gwilym Kuiper 9ba455ca35 Remove the unused arena module 2022-03-23 20:35:58 +00:00
Gwilym Kuiper 3e34509049 Rename get_object to object 2022-03-23 20:34:55 +00:00
Gwilym Kuiper 5791d033ef Rename get_sprite and get_animation_sprite to remove get_ prefix 2022-03-23 20:32:29 +00:00
Gwilym Kuiper 35c7c48f73 Rename get_write_buffer -> write_buffer 2022-03-23 20:26:43 +00:00
Gwilym Kuiper b91f129636 Remove get_ methods for tiled 2022-03-23 20:26:18 +00:00
Gwilym Kuiper 8427bb5595 Remove get_ from timer functions 2022-03-23 20:24:22 +00:00
Gwilym Kuiper c698f858bb Rename get_distance to distance 2022-03-23 20:22:58 +00:00
Gwilym Kuiper 84b7317380 Rename get_location to location 2022-03-23 20:22:37 +00:00
Gwilym Kuiper 48ddda9ae9 Rename get_channel to channel 2022-03-23 20:21:54 +00:00
Corwin 518f73c01e
Merge pull request #189 from corwinkuiper/perfectly-poor-profiler
Problematic poor person's profiler
2022-03-22 22:26:29 +00:00
Corwin adffcc6773 add comment on profiler 2022-03-22 22:08:59 +00:00
Corwin ac9826c4d7 move profiler to be a function 2022-03-22 09:39:03 +00:00
Gwilym Kuiper 1c33c8544e Seems range inclusive doesn't optimise very well... 2022-03-21 23:16:02 +00:00
Gwilym Kuiper 451868723f Add dealloc_no_normalise 2022-03-21 23:01:38 +00:00
Gwilym Kuiper e6d47afa31 Use a hash map rather than an array in vram manager 2022-03-21 22:58:16 +00:00
Gwilym Kuiper 9170acb1a8 Update agb to handle the new agb-image-converter output 2022-03-21 22:57:17 +00:00
Corwin 4bec0d073f The poor profiler 2022-03-21 22:34:15 +00:00
Corwin 3c09a86f88
Merge pull request #198 from corwinkuiper/boxed-interrupts
Boxed interrupts
2022-03-21 22:33:06 +00:00
Corwin aa0337941a add docs 2022-03-21 22:19:07 +00:00
Corwin f312ff7df8 enable interrupts at initialisation 2022-03-21 21:57:46 +00:00
Corwin c74707b1a6 update examples 2022-03-21 21:52:46 +00:00
Corwin 1f3d3380f1 switch interrupts to be in boxes 2022-03-21 21:52:39 +00:00
Gwilym Kuiper e6fb67503b Add a comment explaining where the docs came from 2022-03-21 21:18:56 +00:00
Gwilym Kuiper 447554c295 Add loads of doc comments 2022-03-21 21:16:36 +00:00
Gwilym Kuiper c7db20c1df Implement insert correctly 2022-03-21 20:42:07 +00:00
Gwilym Kuiper 24b61f51fe Implement more of the standard rust API 2022-03-21 20:33:48 +00:00
Gwilym Kuiper 4a1d99f143 Implement Index and FromIterator and add some tests lifted from rust stdlib 2022-03-20 15:38:39 +00:00
Gwilym Kuiper 2b75ce6cbd Implement all of VacantEntry 2022-03-20 15:14:44 +00:00
Gwilym Kuiper 6bc3816b29 Fully implement OccupiedEntry 2022-03-20 15:13:22 +00:00
Gwilym Kuiper 631e1e9bc2 Start implementing the individual entry types 2022-03-20 15:07:25 +00:00
Gwilym Kuiper 921a338c59 Implement the entirity of the entry api 2022-03-20 14:54:53 +00:00
Gwilym Kuiper 2706b2494d Some wiggling 2022-03-20 14:22:43 +00:00
Gwilym Kuiper 86635752af Also implement or_insert_with_key 2022-03-20 14:21:45 +00:00
Gwilym Kuiper ab80f200e8 Encaspulate a bit better 2022-03-20 14:15:24 +00:00
Gwilym Kuiper 9bfb8de481 Wrap distance_to_initial_bucket a bit better 2022-03-20 14:14:22 +00:00
Gwilym Kuiper 3f624ee87d Fail test in extreme case test if we drop twice 2022-03-20 14:10:38 +00:00
Gwilym Kuiper 9df79a16bd Replace slightly dodgy replace code 2022-03-20 14:04:27 +00:00
Gwilym Kuiper bde36c7019 Invert the order of the HashMap, Node and NodeStorage 2022-03-20 13:59:01 +00:00
Gwilym Kuiper e0d829a4fc Rename get_value_ref and get_value_mut to remove get 2022-03-20 13:57:41 +00:00
Gwilym Kuiper 86760f76ac Move resize to a more sensible place 2022-03-20 13:50:04 +00:00
Gwilym Kuiper e9c56327b1 Avoid duplicating constant 2022-03-20 13:43:31 +00:00
Gwilym Kuiper 3ae0e30d3c Correctly drop key on override 2022-03-20 13:42:28 +00:00
Gwilym Kuiper 9c7d9520a7 Add test that we drop the key on override 2022-03-20 13:41:31 +00:00
Gwilym Kuiper d4ed1cd2fa Allow swapping out the hasher 2022-03-19 23:13:02 +00:00
Gwilym Kuiper e68a4d373f Replace .map().flatten() with .and_then() 2022-03-19 23:10:12 +00:00
Gwilym Kuiper 280e7f876d Add some drop tests 2022-03-19 23:09:21 +00:00
Gwilym Kuiper ee983ef7ec Use MaybeUninit to reduce memory usage by half 2022-03-19 23:09:21 +00:00
Gwilym Kuiper cd9798d01f Move the implementation of get_location to NodeStorage 2022-03-19 23:09:21 +00:00
Gwilym Kuiper 321702531b Move number_of_items to NodeStorage 2022-03-19 23:09:21 +00:00
Gwilym Kuiper 0e89f9190f Rename NodeStorage.len() to NodeStorage.capacity() 2022-03-19 23:09:21 +00:00
Gwilym Kuiper fdc2172b3d Move max_distance_to_initial_bucket to NodeStorage 2022-03-19 23:09:21 +00:00
Gwilym Kuiper cc53b0a911 Change distance_to_initial_bucket to be an i32 2022-03-19 23:09:21 +00:00
Gwilym Kuiper ff709d9d57 Use .drain(..).flatten() 2022-03-19 23:09:21 +00:00
Gwilym Kuiper e9d3c6e5c4 Fix clippy lint that we should define is_empty 2022-03-19 23:09:21 +00:00
Gwilym Kuiper eb00563b09 Add extreme test case and fix bug causing disappearing entries 2022-03-19 23:09:21 +00:00
Gwilym Kuiper 89cc00f8cf Sized is implied 2022-03-19 23:09:21 +00:00
Gwilym Kuiper a6c7eaec1a Correctly calculate new distance to initial bucket 2022-03-19 23:09:21 +00:00
Gwilym Kuiper 12dab0c3ba Fix issue where we weren't considering 0 distance correctly 2022-03-19 23:09:21 +00:00
Gwilym Kuiper f7eb1866c2 Remove hashbrown from object.rs 2022-03-19 23:09:20 +00:00
Gwilym Kuiper 5edd46e085 Add default implementation 2022-03-19 23:08:45 +00:00
Gwilym Kuiper 6ff4cbe4f1 Rename put to insert 2022-03-19 23:08:45 +00:00
Gwilym Kuiper a9115c23e8 Allow for resizing 2022-03-19 23:08:45 +00:00
Gwilym Kuiper 8d976b49bc Extract a node_storage 2022-03-19 23:08:45 +00:00
Gwilym Kuiper e999b44c67 Put nodes in a NodeStorage 2022-03-19 23:08:45 +00:00
Gwilym Kuiper 03f5cd0953 Add with_capacity method 2022-03-19 23:08:45 +00:00
Gwilym Kuiper c0d9f0ab41 Correctly initialise to 16 elements 2022-03-19 23:08:45 +00:00
Gwilym Kuiper bfdca7117d Make fast_mod constant 2022-03-19 23:08:45 +00:00
Gwilym Kuiper dd5aad0de5 Make HashMap struct public 2022-03-19 23:08:45 +00:00
Gwilym Kuiper 05b8accaec Make the hash_map mod public 2022-03-19 23:08:45 +00:00
Gwilym Kuiper a459a4811c Add test for iterating through all entries 2022-03-19 23:08:45 +00:00
Gwilym Kuiper bfebba1ec1 Implement remove 2022-03-19 23:08:45 +00:00
Gwilym Kuiper 019872b8cc Really basic hash map which you can only add stuff to 2022-03-19 23:08:45 +00:00
Corwin 82922abddb
Merge pull request #188 from corwinkuiper/crate-version-numbers
be less specific in version numbers
2022-03-19 15:19:28 +00:00
Gwilym Kuiper 60657126ad Add comment about the #[allow] 2022-03-18 22:02:07 +00:00
Gwilym Kuiper ccdb0e4921 Add an allow for the clippy bug 2022-03-18 22:01:02 +00:00
Gwilym Kuiper 7ae565b2c3 Remove unused import 2022-03-18 21:53:30 +00:00
Corwin 9d0fa2f40e even less specific 2022-03-18 21:35:32 +00:00
Gwilym Kuiper add3ccd5fb
Merge pull request #186 from gwilymk/fail-build-if-there-is-an-error
Fail build if there is an error
2022-03-13 20:22:45 +00:00
Gwilym Kuiper ec8d692029
Merge pull request #185 from gwilymk/use-dma-in-objects
Use dma in objects
2022-03-13 20:14:23 +00:00
Gwilym Kuiper b88ad5cba5 VRamManager should definitely not have a public new 2022-03-13 20:12:49 +00:00
Gwilym Kuiper 5bf78f6274 Also for raw copy 2022-03-13 19:53:55 +00:00
Gwilym Kuiper ef8b2edc63 Also dma the palette in backgrounds 2022-03-13 19:53:07 +00:00
Gwilym Kuiper 989fcea1d0 Fix typo in exception 2022-03-13 19:43:03 +00:00
Gwilym Kuiper ea3d3d4936 Rename dma_copy to dma_copy16 2022-03-13 19:37:27 +00:00
Gwilym Kuiper 056a38703d Use dma in objects 2022-03-13 19:37:08 +00:00
Gwilym Kuiper 50ce96ac82 Delete library cargo.locks 2022-03-12 23:39:58 +00:00
Gwilym Kuiper 3710d9ad1c
Merge pull request #182 from gwilymk/better-backgrounds-gwilym
Improve background management
2022-03-12 23:26:42 +00:00
Corwin 44c7a93fa3 use new api 2022-03-12 17:36:38 +00:00
Corwin e2bb5cc5c9 add panicing and try variants of api 2022-03-12 17:36:30 +00:00
Gwilym Kuiper 87c5d6ca6a Use the new allocator 2022-03-11 21:49:23 +00:00
GBA bot 3482697a25 Update lockfiles 2022-03-08 00:28:19 +00:00
Renovate Bot ba0ce97e5a
Update Rust crate rustc-hash to 1.1 2022-03-08 00:27:15 +00:00
Gwilym Kuiper cdd77afe22 Merge remote-tracking branch 'origin/master' into better-backgrounds-gwilym 2022-03-07 22:41:11 +00:00
Corwin eb6b2ac5a8 initialise to correct values 2022-03-07 22:03:49 +00:00
Corwin 8c2931aca5 remove unused import 2022-03-07 20:40:53 +00:00
Corwin 40c4a26cb1 update example 2022-03-07 20:38:13 +00:00
Corwin 8f7e7748e2 Graphics 2022-03-07 20:38:06 +00:00
Corwin 6f064b0d99 update lock files 2022-03-06 13:45:16 +00:00
Corwin 4c57f85acd Inline the modulos 2022-03-06 13:37:09 +00:00
Corwin 900cd007df pull out constants 2022-03-06 13:37:07 +00:00
Corwin c55ff3f714 const fnify 2022-03-06 13:36:50 +00:00
Corwin 8a6f341421 update hat chooses wizard 2022-03-06 13:36:26 +00:00
Corwin 4780b8525d remove unused import 2022-03-06 13:31:56 +00:00
Corwin 592a0814f8 non optional feature alloc 2022-03-06 13:31:56 +00:00
Corwin 84e6af5d2f load aseprite files directly with asefile 2022-03-06 13:31:56 +00:00
Corwin 02e6194073 make fields private 2022-03-06 13:31:56 +00:00
Corwin 6bafa3ebab use public api 2022-03-06 13:31:56 +00:00
Corwin ecf31fa833 load multiple 2022-03-06 13:31:56 +00:00
Corwin b3db55330a sprites example 2022-03-06 13:31:56 +00:00
Corwin 25da2a2711 expose the inner proc macro in a macro rules 2022-03-06 13:31:56 +00:00
Corwin efe67423c1 use the types 2022-03-06 13:31:56 +00:00
Corwin 16ff9b8ec1 types for nice sprite import and usage 2022-03-06 13:31:54 +00:00
Corwin 80e53d4716 volatile writes 2022-03-06 13:31:36 +00:00
Corwin c1901819af unblank screen on object init 2022-03-06 13:31:36 +00:00
Corwin 45823273ac satisfy linter 2022-03-06 13:31:36 +00:00
Corwin da9a15402e use more efficient hash function 2022-03-06 13:31:36 +00:00
Corwin 8792146ddb use correct copys 2022-03-06 13:31:36 +00:00
Corwin ae681019bb set palette location on sprite change 2022-03-06 13:31:36 +00:00
Corwin 2a7b350f57 objects now exist and work 2022-03-06 13:31:36 +00:00
Corwin a1b67e107f object controller implementations 2022-03-06 13:31:36 +00:00
Corwin 836143e1f4 copy the sprite and palette data 2022-03-06 13:31:36 +00:00
Corwin d764ff9900 allocate palettes too 2022-03-06 13:31:36 +00:00
Corwin 6a2c9d8826 add some sprite allocation 2022-03-06 13:31:36 +00:00
Corwin 93d994360e make alloc and dealloc public 2022-03-06 13:31:36 +00:00
Corwin 1849571344 sprite allocator 2022-03-06 13:31:34 +00:00
Corwin beb9abbb7e allocator methods pulled out of global alloc trait 2022-03-06 13:30:47 +00:00
Corwin 475edadcb9 extend to also supporting the end 2022-03-06 13:30:47 +00:00
Corwin 3c6c7efc79 allocator that can have a custom start point 2022-03-06 13:30:47 +00:00
Gwilym Kuiper 39a8b5a64f Update lockfiles 2022-03-05 20:52:26 +00:00
Gwilym Kuiper 803527be23 Fix warning in release mode 2022-03-05 19:52:57 +00:00
Gwilym Kuiper ba1c2e3eaf Remove unused import 2022-03-05 19:45:01 +00:00
Gwilym Kuiper d97ceca647 Remove unused function 2022-03-05 19:44:21 +00:00
Gwilym Kuiper 09f6736497 Extract dma_copy to its own module 2022-03-05 19:43:48 +00:00
Gwilym Kuiper 068bc95fe7 Fix warning with non-constant string 2022-03-05 19:35:19 +00:00
Gwilym Kuiper a3e5187457 Use DMA to copy the entire internal map in one go 2022-03-05 19:35:07 +00:00
Gwilym Kuiper 7b43debd3e WIP: Try removing the hashmap 2022-03-05 19:25:55 +00:00
Gwilym Kuiper aa7823232b Try using a vec of vecs rather than a hashmap 2022-03-05 19:25:09 +00:00
Gwilym Kuiper ceb17a0186 Update hat chooses wizard and purple night 2022-03-05 19:25:09 +00:00
Gwilym Kuiper 22c6e37c88 Finally extract InfiniteScrolledMap 2022-03-05 19:25:09 +00:00
Gwilym Kuiper 6b492c5956 Extract more to new files 2022-03-05 19:25:09 +00:00
Gwilym Kuiper 78fb706c9a Extract map to its own file 2022-03-05 19:25:09 +00:00
Gwilym Kuiper e88602b570 Get my brackets correct 2022-03-05 19:25:09 +00:00
Gwilym Kuiper a35119fdbd Fix hat chooses the wizard 2022-03-05 19:25:09 +00:00
Gwilym Kuiper 742231fbc5 Try a different transparent tile then 0 2022-03-05 19:25:09 +00:00
Gwilym Kuiper ed2af0d57e Extract VRamManager to the tiled module 2022-03-05 19:25:09 +00:00
Gwilym Kuiper f1bc09d6cd Avoid crackle on load 2022-03-05 19:25:09 +00:00
Gwilym Kuiper d896adfad5 Clear the backgrounds once they aren't used any more 2022-03-05 19:25:09 +00:00
Gwilym Kuiper de594ad362 Make init take an impl Fn rather than a Box<dyn Fn()> 2022-03-05 19:25:09 +00:00
Gwilym Kuiper 3a913f142a Remove pop while loading a level 2022-03-05 19:25:09 +00:00
Gwilym Kuiper b0b8ec55c4 Remove unused TILE_BACKGROUND 2022-03-05 19:25:09 +00:00
Gwilym Kuiper 63dd837518 Tiny performance improvement with dma to copy the tile data 2022-03-05 19:25:09 +00:00
Gwilym Kuiper 08aeb56f1e Update background and foreground independentently 2022-03-05 19:25:06 +00:00
Gwilym Kuiper 3941117aa7 Switch to rustc-hash 2022-03-05 19:24:28 +00:00
Gwilym Kuiper 06901b3543 Move post-work to pre-work 2022-03-05 19:23:53 +00:00
Gwilym Kuiper 530b71e0df Copy slightly too much 2022-03-05 19:23:53 +00:00
Gwilym Kuiper a365c14917 Small fixes 2022-03-05 19:23:53 +00:00
Gwilym Kuiper 3a795fea8f Handle moving up to 10 tiles at once 2022-03-05 19:23:53 +00:00
Gwilym Kuiper 610be70b92 Correctly set the initial offset value in init() 2022-03-05 19:23:53 +00:00
Gwilym Kuiper a998ae31a4 Correctly use the map width and not the display width 2022-03-05 19:23:53 +00:00
Gwilym Kuiper ebf21f4add Avoid pointless copies 2022-03-05 19:23:53 +00:00
Gwilym Kuiper 66a61e33e6 More correctly special case tile 0 2022-03-05 19:23:53 +00:00
Gwilym Kuiper 666867e933 Track the generation along with the tile data 2022-03-05 19:23:53 +00:00
Gwilym Kuiper 10c97f48d8 Introduce the MapLoan to infinite scrolled map 2022-03-05 19:23:53 +00:00
Gwilym Kuiper 2c8fce40d3 Store the used backgrounds in a bit array 2022-03-05 19:23:53 +00:00
Gwilym Kuiper cd05fee360 Use a concrete type for the TileReference 2022-03-05 19:23:53 +00:00
Gwilym Kuiper 5793d6b6ab Introduce methods for increasing and decreasing the reference 2022-03-05 19:23:53 +00:00
Gwilym Kuiper 2a04ebd884 Rename TileReference to VRamState 2022-03-05 19:23:53 +00:00
Gwilym Kuiper 5533c9c052 Fix reuse issue 2022-03-05 19:23:53 +00:00
Gwilym Kuiper a2c6c6a70c Make the tile references clearer 2022-03-05 19:23:53 +00:00
Gwilym Kuiper bf10d9a5ff Try copying the correct amount 2022-03-05 19:23:53 +00:00
Gwilym Kuiper 7f0d7757c5 Really trying hard to get this working 2022-03-05 19:23:53 +00:00
Gwilym Kuiper f785d65057 Something that seems like it is close to working 2022-03-05 19:23:50 +00:00
Gwilym Kuiper 472875edac Update the wave example 2022-03-05 19:21:54 +00:00
Gwilym Kuiper 38e57489a3 Rework the settings a little to allow for raw tile ids 2022-03-05 19:21:54 +00:00
Gwilym Kuiper cf72a9331a Add API for setting tile data from just a number 2022-03-05 19:21:54 +00:00
Gwilym Kuiper 1286a58511 Ensure that we don't copy twice 2022-03-05 19:21:54 +00:00
Gwilym Kuiper 0081d1c6ee Update the chicken example 2022-03-05 19:21:54 +00:00
Gwilym Kuiper 06c988e952 Fix the test logo and the example 2022-03-05 19:21:54 +00:00
Gwilym Kuiper 8fcb9e607d Special case the first element in references 2022-03-05 19:21:54 +00:00
Gwilym Kuiper bdeaf346cd Remove the old tile before creating the new one 2022-03-05 19:21:54 +00:00
Gwilym Kuiper 2044cbf379 Generation makes more sense to be a u16 for better data storage 2022-03-05 19:21:54 +00:00
Gwilym Kuiper 0ebd2c2e40 transparent is probably more correct 2022-03-05 19:21:54 +00:00
Gwilym Kuiper 1562e63bee Marker is a better name for this probably 2022-03-05 19:21:54 +00:00
Gwilym Kuiper 7c3725497c Add method to hide background 2022-03-05 19:21:54 +00:00
Gwilym Kuiper 93d82f309e Test logo now displays 2022-03-05 19:21:54 +00:00
Gwilym Kuiper b2c16f754b Add some room to breathe 2022-03-05 19:21:54 +00:00
Gwilym Kuiper effaac3885 hopefully enough to actually maybe display something? 2022-03-05 19:21:54 +00:00
Gwilym Kuiper 5ea6eb0f1d Complete re-do of tile storage management in backgrounds 2022-03-05 19:21:54 +00:00
Gwilym Kuiper 6690538781 Some inlines in SoundChannel which weren't being inlined for some reason 2022-03-05 18:51:17 +00:00
GBA bot 03dfaf9d5f Update lockfiles 2022-03-01 20:07:25 +00:00
GBA bot 84ee900e18 Update lockfiles 2022-02-24 20:50:57 +00:00
GBA bot 5a7efa660a Update lockfiles 2022-02-24 20:37:17 +00:00
Corwin Kuiper 1c5978e806 update lock files 2022-01-22 13:11:06 +00:00
Gwilym Kuiper 0744027b39 Update lockfiles 2022-01-20 23:00:53 +00:00
Corwin 5a861e7d48
Merge pull request #161 from corwinkuiper/alloc-better
Improving allocator
2022-01-20 22:53:35 +00:00
Gwilym Kuiper 5f753d791a Fix the entry link and the syntax 2022-01-20 22:34:30 +00:00
Corwin Kuiper 970b38e7da module level docs and test cfg 2022-01-20 22:28:52 +00:00
Corwin Kuiper f7693f553c pad the either layout to align 2022-01-20 22:20:54 +00:00
Corwin Kuiper fc6acda14d add some explanatory comments 2022-01-20 22:20:17 +00:00
Corwin Kuiper 08e07a0d37 merge multiple blocks 2022-01-20 19:06:48 +00:00
Corwin Kuiper 1614e46c4e move test runner to own module 2022-01-18 19:49:07 +00:00
Corwin Kuiper e75adf9e67 check no blocks are leaked during testing 2022-01-18 19:33:25 +00:00
Corwin Kuiper 49c8720c8c A nice allocator!! Merges blocks together 2022-01-18 19:32:22 +00:00
Corwin Kuiper 03e9517215 only use critical section once 2022-01-17 21:46:14 +00:00
Corwin Kuiper 17de9a42bd use bare_metal mutex 2022-01-17 21:44:25 +00:00
Gwilym Kuiper a9e728a037
Merge pull request #160 from gwilymk/make-agb-entry-create-gba-struct
Make agb entry create gba struct
2022-01-17 19:47:44 +00:00
Gwilym Kuiper 3366bfbfdf Remove siphasher by using DefaultHasher::new instead 2022-01-16 22:10:57 +00:00
Gwilym Kuiper 6d8d72077f Make it harder to call by accident 2022-01-16 21:50:18 +00:00
Gwilym Kuiper 040ff2eb0c Update the rust doc 2022-01-16 21:48:45 +00:00
Gwilym Kuiper cf9ea504f6 Update agb tests and all the examples 2022-01-16 21:38:30 +00:00
Gwilym Kuiper 17867da596
Merge pull request #155 from agbrs/renovate/syn-1.x
Update Rust crate syn to 1.0.85
2022-01-12 23:18:16 +00:00
Gwilym Kuiper d44e0fc796 Update lockfiles 2022-01-12 23:05:02 +00:00
Gwilym Kuiper 19f071fd5a Use agb::fixnum rather than agb::number 2022-01-12 22:09:57 +00:00
Corwin Kuiper 5b7e1a760d split to own crate 2022-01-07 16:59:19 +00:00
Corwin Kuiper 3bb3dcf1b6 allow the remaining warnings from clippy 2022-01-06 19:50:35 +00:00
Corwin Kuiper e5efdcd29c move use to inside function 2022-01-06 19:48:44 +00:00
Corwin Kuiper 222efe9122 move tests to conditionally compiled modules
also only enable custom test framework feature in test mode
2022-01-06 19:47:30 +00:00
Corwin 039bc0acb1
Merge pull request #153 from corwinkuiper/remove-step
remove the step feature
2022-01-04 00:42:33 +00:00
Corwin Kuiper 0e55916865 add test 2022-01-04 00:31:27 +00:00
GBA bot 60e78768a4 You don't need extern crate agb; any more 2022-01-04 00:16:25 +00:00
Corwin Kuiper 6d829bd741 remove the step by feature
should have test to make sure it does what I want it to do
2022-01-04 00:10:51 +00:00
Gwilym Kuiper e601cc53ca
Merge pull request #151 from gwilymk/remove-feature-asm-now-that-it-is-stable
Remove feature(asm) now that it is stable
2022-01-03 23:53:10 +00:00
GBA bot 234db0da96 Set waitstate to 0x4317 as is standard in most games 2022-01-03 23:27:31 +00:00
GBA bot 8afc57c158 Remove feature(asm) now that it is stable 2022-01-03 23:02:26 +00:00
Corwin 311c26caad
Merge pull request #149 from gwilymk/pong-book
First 3 chapters on writing a pong game
2022-01-03 23:01:34 +00:00
GBA bot f62501a748 Update the examples to correctly use the new API 2022-01-02 21:48:05 +00:00
GBA bot 6277eaeaee Split vblank() into frame() and after_vblank() 2022-01-02 21:47:08 +00:00
GBA bot 8d13ee3a39 Add some blank lines to make code folding work better 2022-01-02 18:28:31 +00:00
GBA bot 99146ac048 Add doc comments for top level modules 2022-01-02 18:27:23 +00:00
GBA bot 0b986df563 Doc hide test runner stuff 2022-01-02 18:25:44 +00:00
GBA bot d4daf8bf0a Add docs for entry macro 2022-01-02 18:22:13 +00:00
GBA bot 02939041b4 Use the entry macro for the test main 2022-01-02 18:14:37 +00:00
GBA bot af40d48360 Add section on loading graphics and document the include_gfx! macro 2022-01-02 18:11:36 +00:00
GBA bot a39d5cfd69 Add some more documentation 2022-01-02 11:27:26 +00:00
GBA bot b5ff4991fa Use builder style for ObjectStandard 2022-01-02 11:14:18 +00:00
GBA bot 618929939f Document the Gba struct 2022-01-01 23:15:14 +00:00
GBA bot 3a8ec51ce1 Make Cargo.lock consistent with Cargo.toml 2022-01-01 22:21:58 +00:00
Renovate Bot 2e042d87c9
Update Rust crate bitflags to 1.3 2022-01-01 21:08:27 +00:00
GBA bot fa88bc40c6 Add another missing must_use 2022-01-01 11:35:49 +00:00
GBA bot 5f13c69fcf Replace .map.flatten with .flat_map 2022-01-01 11:35:17 +00:00
GBA bot afe69b98b8 Add a bunch of must_use now requested by clippy 2022-01-01 11:34:43 +00:00
GBA bot 21c934623d Import the new asm macro required in newer versions of nightly 2022-01-01 11:20:30 +00:00
Corwin Kuiper 38703c7cb8 add different implementation of sqrt 2021-12-06 23:31:42 +00:00
Corwin Kuiper 3800be4dcb test for accuracy of magnitude function 2021-12-06 22:51:43 +00:00
Corwin Kuiper affa27c8e0 remove unused crate 2021-12-06 22:43:58 +00:00
Corwin Kuiper 9a25274bb0 switched the magnitude function to use the alpha max + beta min algorithm 2021-12-06 19:49:27 +00:00
Corwin Kuiper b347f9338e actually test base B in test base 2021-12-04 13:52:47 +00:00
Corwin 453e098703
Merge pull request #135 from corwinkuiper/number-macro
create a number macro that can use floating point numbes
2021-12-04 03:11:26 +00:00
Corwin Kuiper ecd04190fa remove unused stuff 2021-12-04 02:57:51 +00:00
Corwin Kuiper 6e0cbbe9eb create a number macro that can use floating point numbes 2021-12-04 02:44:57 +00:00
Gwilym Kuiper 69e3c299ca Fix clippy lint 2021-11-22 19:33:09 +00:00
Gwilym Kuiper a331909370 Assert that gba struct is zero sized 2021-11-22 19:28:58 +00:00
Gwilym Kuiper 75bd475f08 Split out to a timer controller to keep the GBA struct zero sized 2021-11-22 19:27:08 +00:00
Gwilym Kuiper f7a10677dd Allow use of timer again after mixer is done 2021-11-22 19:14:51 +00:00
Gwilym Kuiper bfc02e0aa8 Make sound now take the first class timer object 2021-11-18 22:28:26 +00:00
Gwilym Kuiper 8876c47aa9 Remove the generics (sorry that GBA is no longer zero sized...) 2021-11-18 22:28:26 +00:00
Gwilym Kuiper 8ef46279c8 set overflow amount should take a mut self 2021-11-18 22:28:26 +00:00
Gwilym Kuiper 20511843ca Move timers to be fields in the controller 2021-11-18 22:28:26 +00:00
Gwilym Kuiper fd610d8cc1 Add support for timers 2021-11-18 22:28:26 +00:00
Corwin b88cf39a67
Merge pull request #130 from gwilymk/fix-printing-of-negative-numbers
Fix printing of negative numbers
2021-11-18 22:16:34 +00:00
Corwin Kuiper 8143d43149 fix clippy lint 2021-11-18 21:30:35 +00:00
Gwilym Kuiper e1e4318c38 Add comment explaining how the fiddle works 2021-11-18 21:11:29 +00:00
Gwilym Kuiper 89f89803dd GREEN: Fudge fractional and integral bits to get negative numbers to work 2021-11-18 21:05:29 +00:00
Gwilym Kuiper 413a819e64 Fix compiler warning for tests 2021-11-18 20:57:18 +00:00
Gwilym Kuiper 2eec47f31a RED: Add failing tests for negative number printing 2021-11-18 20:57:18 +00:00
Corwin Kuiper 7ba84b7691 add registers to sqrt clobber list
will need to go through the other syscalls and find out whether we need
to add registers to the clobber list. We probably need to add all per
the call convention (r0, r1, r2, r3 are callee saved).
2021-10-31 20:14:41 +00:00
Gwilym Kuiper 5c10af2f72 Add methods for getting and setting a palette colour 2021-10-30 21:16:40 +01:00
Gwilym Kuiper a92a2f503c Reduce maximum number of sound channels to 8 2021-10-30 21:16:32 +01:00
Corwin Kuiper 301e2c115a fix tile ids 2021-10-30 20:33:54 +01:00
Corwin Kuiper d0808cb7f2 added helpful functions 2021-10-30 18:38:57 +01:00
Gwilym Kuiper 6ed9b06b22 Ensure that the buffer size isn't actually the first instruction in add 2021-10-30 16:02:40 +01:00
Gwilym Kuiper 6ac3789d11 Export ChannelId 2021-10-30 15:38:59 +01:00
Corwin Kuiper b492f3d43d fix rect issue with touching 2021-10-30 12:24:43 +01:00
Corwin Kuiper be44dbed3d add useful derives 2021-10-30 10:12:45 +01:00
Corwin Kuiper 2838ea5f32 add more maths 2021-10-29 18:34:42 +01:00
Gwilym Kuiper c6e7827e34 Add support for 18157Hz 2021-10-29 15:51:05 +01:00
Gwilym Kuiper 26620e850e Have the constants only in one place 2021-10-29 15:51:05 +01:00
Gwilym Kuiper 46b40c8e5b channel.data.len() = 2 * channel.pos 2021-10-29 14:29:22 +01:00
Gwilym Kuiper 5266e7a40c Release agb v0.8.0 2021-10-28 22:28:45 +01:00
Gwilym Kuiper c49952eff9 Reduce the length of the examples 2021-10-28 22:27:08 +01:00
Gwilym Kuiper 0a68eee3f9 Remove unused field 2021-10-28 21:48:22 +01:00
Gwilym Kuiper e3a35a2eda Release agb-sound-converter v0.1.0 2021-10-28 21:39:33 +01:00
Corwin 2391acb68d
Merge pull request #116 from corwinkuiper/nice-objects
Sane Objects!
2021-10-27 18:32:08 +01:00
Corwin b7734726a6
Merge pull request #123 from gwilymk/stereo-sound
Stereo sound
2021-10-27 18:30:37 +01:00
Corwin 3f310b70a2
Merge pull request #119 from corwinkuiper/partial-backgrounds
possible iter for backgrounds
2021-10-27 18:30:25 +01:00
Gwilym Kuiper 1d38b75289 Reduce stereo mixing by 1 instruction 2021-10-26 23:09:50 +01:00
Gwilym Kuiper 9524b4b3c3 Loads of comments to explain what all the steps are doing 2021-10-26 22:25:35 +01:00
Gwilym Kuiper 050ee184b0 Add stereo sound example 2021-10-26 22:14:46 +01:00
Gwilym Kuiper 5bd656d8cb Add support for stereo sound 2021-10-26 22:14:34 +01:00
Corwin Kuiper ec0d4431ad allow direct access to screen 2021-10-24 20:41:21 +01:00
Corwin Kuiper f2c4354c1b reduce to a byte array 2021-10-23 17:15:57 +01:00
Corwin Kuiper 713791b3fe satisfy linter 2021-10-23 17:15:57 +01:00
Corwin Kuiper 8d0c50b37a affines are referenced counted with the new RC arena(ish) implementation 2021-10-23 17:15:53 +01:00
Gwilym Kuiper 4f0b01b932 Add option to mark sound as stereo 2021-10-18 21:22:36 +01:00
Gwilym Kuiper e92383e29c
Merge pull request #121 from gwilymk/agb-sound-converter
Agb sound converter
2021-10-18 21:19:31 +01:00
Gwilym Kuiper eb26a21629 Attempt to make it so that the sound converter doesn't create too many tokens 2021-10-17 23:22:36 +01:00
Gwilym Kuiper 66e201ae39 Update example to use the new macro 2021-10-17 22:38:19 +01:00
Corwin Kuiper d22e46f7e3 resolve some clippy lints 2021-10-17 22:08:33 +01:00
Corwin Kuiper 1541d514c9 possible iter for backgrounds 2021-10-17 21:59:57 +01:00
Gwilym Kuiper 6f804d884b Release agb v0.7.0 2021-10-04 23:43:18 +01:00
Gwilym Kuiper cc62ef72a7 Release agb-macros v0.1.0 2021-10-04 21:02:52 +01:00
Corwin Kuiper df98f58c0e fix clippy lints 2021-10-04 20:56:28 +01:00
Gwilym Kuiper 94309a2518
Merge pull request #113 from gwilymk/add-test-for-rust-bug
Add test that data_end is in the correct place
2021-10-04 20:38:54 +01:00
Corwin 3e94bd27ee
Merge pull request #101 from corwinkuiper/sane-backgrounds
Sane backgrounds
2021-10-04 20:34:12 +01:00
Gwilym Kuiper a31efe7156 Add test that data_end is in the correct place 2021-10-04 20:15:34 +01:00
Gwilym Kuiper 25cca44b6b Cargo fmt 2021-10-03 23:26:02 +01:00
Gwilym Kuiper 871d90c889 Special case mixer without multiplication 2021-10-03 23:00:43 +01:00
Corwin Kuiper 9192722f5a fix build 2021-09-19 20:56:36 +01:00
Corwin Kuiper f7c2118a40 start work on separating out background sizes 2021-09-19 20:17:50 +01:00
Corwin Kuiper 1ae3c34877 begin work on affine regular compatability 2021-08-28 23:02:35 +01:00
Corwin Kuiper 3d269c98fd split blocks 2021-08-21 12:56:15 +01:00
Corwin Kuiper 63d880f083 no point checking if null and returning null 2021-08-21 12:03:30 +01:00
Corwin Kuiper 6523a3c6b8 free list allocator 2021-08-21 11:07:53 +01:00
Corwin e5f331587f
Merge pull request #108 from gwilymk/simple-alloc-implementation
Simple alloc implementation
2021-08-18 00:04:40 +01:00
Gwilym Kuiper 6d11302725 Fix clippy lint in the allocator 2021-08-16 23:40:16 +01:00
Gwilym Kuiper bec0cc6055 Make alloc an optional default feature 2021-08-16 23:32:31 +01:00
Gwilym Kuiper 469db77437 Add allocation example 2021-08-16 23:28:33 +01:00
Gwilym Kuiper 22189eb809 Add some more allocation tests 2021-08-16 23:20:51 +01:00
Gwilym Kuiper b30cc7715c Add really simple block reuse 2021-08-16 22:55:02 +01:00
Gwilym Kuiper e80ad601a3 Extract current alloc to a new_block function 2021-08-16 22:33:56 +01:00
Gwilym Kuiper d372ca74bf Use the block allocator by default now 2021-08-16 22:31:10 +01:00
Gwilym Kuiper 4b9e4ce42a Move tests to agb_alloc mod.rs 2021-08-16 22:28:41 +01:00
Gwilym Kuiper 7425e9973d Add a really basic block allocator 2021-08-16 22:25:08 +01:00
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