Commit graph

583 commits

Author SHA1 Message Date
Michel Heily d4b91257b7 Gotta make clippy happy #2
Former-commit-id: 25d2b2b52c4113ceb299908248773bb7e4bfd6c9
Former-commit-id: a612adacf46b62d8a5bd78bdcd3b0bc6323898a5
2022-09-05 01:34:21 +03:00
Michel Heily 25b630951d Gotta make clippy happy
Former-commit-id: b2e4b28ae9d054020891029ae0be5e148357779e
Former-commit-id: fd0c17e9729f35fd40bd3c75fe53907129776445
2022-09-05 01:19:00 +03:00
Michel Heily 12d9edf5c4 Fix some cargo-clippy, and broken sub-crates
Former-commit-id: 93db7bc11bff9a48f4d66e0a378cd77ab42ca197
Former-commit-id: a6ce714c2a6a4112ff30d748c0686b1b2da41c6b
2022-09-05 00:34:00 +03:00
Michel Heily 255806ff69 Move rustbodyadvance-jni to platform/
Former-commit-id: c4565bfe5bf7c4887b6b86c44afbf6b55ac76811
Former-commit-id: b3f296200b0a718ba5509db0cce1117e0fb38a1a
2022-09-05 00:02:00 +03:00
Michel Heily 28fb9ffa70 chore: Refactor into crates
Been wanting to do this for a long time.
This does impose performance issues when building with the vanilla
release profile, as cargo does not perform optimizations across crate
boundary (we care mostly about inlining).
so I added release-lto profile

Also fixed some broken stuff I found across the project, meh


Former-commit-id: 06d03263cc6245313f3ea22c715479ab6da7c4d4
Former-commit-id: f93abd10c67ea8a3b8072b47462be5eca4f3e02b
2022-09-04 23:54:44 +03:00
Michel Heily 1535062e6c Make the rustboyadvance-sdl2 as the default target for cargo
Former-commit-id: 30a23b71305ba7dc7e18f843f08b8e544dae825e
Former-commit-id: 8d23da59ad40a8f716cdbc06f56a9c4d7bd471e1
2022-09-04 22:10:16 +03:00
Michel Heily 8ea942e973 Update my cargo profiles
Former-commit-id: bdc727d4a0a3f7138d2d97505d7ef75cac24b575
Former-commit-id: 17f26c2a5e831c0b361cd328d8d2f72a440e4c89
2022-09-04 22:08:50 +03:00
Michel Heily 8572b220a8 Update Cargo.lock
Former-commit-id: e29a6dbe504fe5ad3103aa40d0940a8a539fff75
Former-commit-id: 2dcd224e28d8240930d1ae02aa5b4b86ee2f6ec2
2022-09-04 02:51:51 +03:00
Michel Heily 91453e8777 Refactor&improve the scheduler to handle missed events
Solves #168


Former-commit-id: 09104a6ebefdaf2e33ae22eb08860d9711ecb66b
Former-commit-id: e07219e40fa187f516dd266ab753a67f3c7e796b
2022-09-04 02:51:44 +03:00
MichelOS 7af9bc5760 Update build.yml
Add ability to manually trigger builds as the github artifacts expired UwU 3:

Former-commit-id: dc8c4658dbf0d06c6189d4b953b7909cdc3243b2
Former-commit-id: a73e54b5f843e60ec13ea005bf921a187975a426
2022-03-15 14:34:38 +02:00
Michel Heily 32e2d807bd Update README.md with the minimal rust version
Former-commit-id: e45a46fa5803f049c8461b36d734134af9d75e77
Former-commit-id: c59ed03a400b5d36a2452592047c131118a72fbb
2021-07-04 00:37:49 +03:00
Michel Heily 47032ec8b9 arm: Forgot this one :)
Former-commit-id: 7e6dfc766fd4b3872bffa08cfa2276d7517ba048
Former-commit-id: 4001761f719b98ed98d652ee00275dd1d8f7d232
2021-07-04 00:36:21 +03:00
Michel Heily 76d9102231 arm: remove old code
Former-commit-id: 906a5b902726c000fcdc1a01443c6662da72b2c9
Former-commit-id: ab2dac2ae2c066758645026b6484cd1a9355831a
2021-07-03 22:29:55 +03:00
Michel Heily a7cc770be8 arm: finish converting all instructions to const-generics
Former-commit-id: 4557ecffb89d563357f5bd769515254533a404ac
Former-commit-id: 8ce461f1b48ff5e7c72cdcd3069dcee0960dbc8e
2021-07-03 22:29:55 +03:00
Michel Heily 86c35a2eb3 arm: do const-generics for BlockDataTransfer
Former-commit-id: d4be9648b334891de5a2daf3c2931cf8e31b337a
Former-commit-id: 6e7e54efd9fa3901008d2fab21dab4560d597763
2021-07-03 22:29:55 +03:00
Michel Heily 416cc2937b arm: do const-generics for HalfwordDataTransfer*
Former-commit-id: 891fd23bef3a4ecc7fe5a4012456d51fc91f8601
Former-commit-id: 431ac09cbf73078988d6400c6320a7fdadceef1a
2021-07-03 22:29:55 +03:00
Michel Heily 9819bf611d arm: convert some instructions to const-generics
Former-commit-id: 493127ef64f3d5e396e0391c5bb0db985cac8945
Former-commit-id: 987edb22cd27584dfdee0a23602df45424a6f4b8
2021-07-03 22:29:55 +03:00
Michel Heily 03d28c77b6 thumb: Finish converting all instructions to use const-generics
Former-commit-id: 671c75a985123a52b312a8ae5495ff545d7678dc
Former-commit-id: c0794ce36f410cd8c058cbe087c388a84aae8b85
2021-07-03 22:29:55 +03:00
Michel Heily 4a7eb53707 thumb: more const-generics :)
Former-commit-id: e869dafa68973d944be3b8d88d3238451b64718c
Former-commit-id: 8118d529e7a40303e4535f581ad4cf247b926b46
2021-07-03 22:29:55 +03:00
Michel Heily 9e6b787536 arm: convert more instructions to use const generics
Former-commit-id: bd4c802a49a8c37e6709c2481cc73367bbadade0
Former-commit-id: f3881e4f8fee1a7110cf676c3c62b6c39db88280
2021-07-03 22:29:55 +03:00
Michel Heily 7e96be21ae perf: Move pc to the beginning of the CPU struct
Former-commit-id: 1b17095bee5c6010d3792fc220a8abcf3a373207
Former-commit-id: 5e65dad6398ef6e9d907d086c982fd70e85c9184
2021-07-03 22:29:55 +03:00
Michel Heily 892dfbe395 More const generics..
Former-commit-id: 74e4c88128d8c83bbb23a874ba8e0821ffc583a7
Former-commit-id: 99ed5c5f73ba9ad2e95b9b190e0100d0e1b9e6a2
2021-07-03 22:29:55 +03:00
Michel Heily 0665ff7451 WIP 2 SingleDataTransfer
Former-commit-id: 8a103161f34eb1a6c731c63ae65ca1056117ec55
Former-commit-id: 74c8158e7354253f6bd4ad50488d34de34e3ad70
2021-07-03 22:29:55 +03:00
Michel Heily b3c3c70bce WIP const generics
Former-commit-id: 2c38215fb57de66bfce26cfa7e61c460bd2954ac
Former-commit-id: 8fe5cc4fdc58b1155590dbfd6546b280fcdcc259
2021-07-03 22:29:55 +03:00
Michel Heily 1545be7b4f core: debugger: Improve info command
Former-commit-id: 534b4907911408f3765825145f14d0b680058dcf
Former-commit-id: 20ed0d130e2fb17b9fc6fb7c1cfc485277a6fb10
2021-06-10 00:13:17 +03:00
Michel Heily 82fa433e26 Fix warning: invalid attribute
Former-commit-id: d3a6a4f23c343ba9960269938e1127729271545d
Former-commit-id: 0fc0461c38531a8a841d7dbab14dd4796ab3a77b
2021-06-09 23:39:43 +03:00
Michel Heily 7512bad3a0 core: debugger: Fix dissassembly
Former-commit-id: ec8d6726eb1f599e43b0826e99508cc954454220
Former-commit-id: 3b64d5b60377c303b85be32794df18671002d509
2021-06-09 02:24:51 +03:00
Michel Heily 626c5fa805 core: arm7tdmi: Fix new bug in LDR/STR introduced in b603904.
Of course only arm-wrestler caught it while mgba suite/eggvance did not :(


Former-commit-id: a5dcaa9b40c8a5a5d5fb1e531a601361869a041f
Former-commit-id: eb8d30a3c1cf9c39425b29e6d8386ac2b68a424b
2021-06-09 02:01:47 +03:00
Michel Heily 97704f2621 core: debugger: Fix traces
Former-commit-id: fbdaef86e2164ad1eeb5267041070958c024ceda
Former-commit-id: 643bcfe7ebccf77297d2371715490b3005e91d92
2021-06-09 02:01:42 +03:00
Michel Heily ff472db249 core: debugger: Use mut references for GameBoyAdvance
Former-commit-id: e1490c0777537e7d8eee4e9d1fbb53f8c957fdc7
Former-commit-id: f6be5b7940c4f3d517fa564830be607321ade534
2021-06-09 01:24:31 +03:00
Michel Heily f140e0f83b core: Fix broken debugger build
Former-commit-id: 0dcdb6d758e463eecc02faf5a0e7eff6c8c08899
Former-commit-id: 5e9d842158d573b10dc1ddb4c3621056282351ed
2021-06-09 01:08:42 +03:00
Michel Heily 2ec52fb722 sdl2: Add silent mode
Former-commit-id: b8e3a8809501f32f819b74a1e4dd094d77a4b367
Former-commit-id: 027be1f05ae9f274e6a3527d209ac5ff696d8c56
2021-06-09 00:54:09 +03:00
Michel Heily 67c071595a Add Dockerfile for android targets
Former-commit-id: 97d399e200cef304b1d76b099d7449b4a8f33a0b
Former-commit-id: 842c1a99e6ac83f4caf90560167b8ddb57c8c93d
2021-06-05 20:27:27 +03:00
Michel Heily 20506091cc [perf] arm: Improve performance with barrel shifter.
Instead of using a struct member to hold the last barrel shifter carry output, which is expansive as it needs to be saved/loaded from memory, I now pass the carry around as an INOUT parameter.
Using perf anotate really shows high perctile of samples being spent on reading/writing `self.bs_carry_out`

Since this is a rather "surgical" changeset, I have made sure to run it against eggvance test suite, mGBA test suite and some games as well.

I actually saw better improvements than what the benchmark measured, but 7% is decent enough :)

```
run_60_frames           time:   [180.18 ms 180.45 ms 180.77 ms]
                        change: [-7.2464% -6.9081% -6.6324%] (p = 0.00 < 0.05)
                        Performance has improved.
```


Former-commit-id: 7cd7105a07aa0b78cab9dc8bbae3682b02b7ab7c
Former-commit-id: c68514beb3fa6c34f5f65544acbead21e527dbb0
2021-06-05 18:54:46 +03:00
Michel Heily caf89d8532 Update tasks.json
Former-commit-id: 3dc52edc74606c31c80e2e1ffd0d5fbc74d47123
Former-commit-id: 982303e2a48fe5f7ea64d85bf480ce3df77d54bc
2021-06-05 18:45:05 +03:00
Michel Heily a51a0d4962 Build with debuginfo
Former-commit-id: 3fc245a05643baf60f10d08350baf9e72762d992
Former-commit-id: 14002ce5c901b926258677ed1062ded4f47e5920
2021-06-05 18:44:46 +03:00
Michel Heily 21708a3d58 [perf] sysbus: Improve add_cycls()
Fulfill TODO from long ago, I used perf-record (--call-graph dwarf)  and detected that add_cycles() was hot enough,
I added 2 optimizations:
- Removed bound checks from array accesses
- Increase the LUT size to include dummy entries for open-bus to eliminate the if check

run_60_frames           time:   [183.65 ms 183.69 ms 183.73 ms]
                        change: [-9.4414% -9.2849% -9.1315%] (p = 0.00 < 0.05)
                        Performance has improved.


Former-commit-id: 1cbb596b856e604ad6c48eb0d47771e7cee44d1e
Former-commit-id: 9f15e35237f343d0c816fd9d51d81081736d9e17
2021-06-05 17:31:10 +03:00
Michel Heily cb2b97e0c7 [perf] core: arm7tdmi: Re-arange some fields inside of CPU
Also, clean up some of the cfg(debug) mess

benchmark report:

run_60_frames           time:   [110.61 ms 111.01 ms 111.42 ms]
                        change: [-7.1171% -6.5425% -5.9132%] (p = 0.00 < 0.05)
                        Performance has improved.


Former-commit-id: 9cb82e483c8a78632d0deae20adca9fc1843a76b
Former-commit-id: 6d9be5ddaf72f2b9c02063fa067f2ffbaea4fdb6
2020-11-24 00:54:18 +02:00
Michel Heily 586a5bf16c core: arm7tdmi: Refactor display->disass.
Also, move core::disass into core::arm7tdmi::disass


Former-commit-id: 82f60cb814d6cf23e62565e34b61f8771e704525
Former-commit-id: 345ddaac674c78e77e62f106d7c0deda857fe5ed
2020-11-24 00:45:07 +02:00
Michel Heily 28a57a874a core: dma: Reduce logs
Former-commit-id: 6db019b583e195fcb6aedb134cf54482a6c72428
Former-commit-id: 9294c305aafac1d55f18f1bd5d2fb5c62db509c5
2020-11-06 06:26:00 -08:00
Michel Heily 7e2c9d040a [perf] core: gpu: Refactor to use unpacked mmio configuration during rendering
* Convert gpu bitfield!() registers to unpacked form, and defer pack/unpack to bus read/write operations


Former-commit-id: 26e7d7d62d6418ce7bcdb8e414cabe5ddb56333d
Former-commit-id: 716ddd9fe2b7b95b7613fc549a7bee406272478b
2020-11-06 06:26:00 -08:00
Michel Heily a413ebe891 [perf] core: arm7tdmi: inline arm7tdmi::Core::step function
run_60_frames           time:   [158.26 ms 160.84 ms 163.03 ms]
                        change: [-24.960% -18.808% -12.975%] (p = 0.00 < 0.05)
                        Performance has improved.

Wasn't expecting such an improvment tbh, but who am I to argue with results


Former-commit-id: a5ba74bffa26d962a232c0767a34a7d67ed8ccb4
Former-commit-id: 1b9b301ba9012e79e66822ac39af51df28c51fa4
2020-11-05 15:40:39 -08:00
Michel Heily 05b1ff10e3 [perf] core: gpu: optimize & clean finalize_scanline
Performance benchmark report improvement:
run_60_frames           time:   [176.85 ms 184.70 ms 191.47 ms]
                        change: [-11.727% -7.6991% -4.2923%] (p = 0.00 < 0.05)
                        Performance has improved.


Former-commit-id: ec91f286433c6798a848fa9727a12da38e62fc61
Former-commit-id: 8d0feea1e0d6b8230c71872bb4458aeec2f7d0e7
2020-11-05 15:40:39 -08:00
Michel Heily 22f544718a core: Add performance benchmark
Former-commit-id: 0fcda8fb5b8a506e22f74d0ef186a38708ed4def
Former-commit-id: fd390604a7e01d9a67ffa0a70c5e9863f65fc9f8
2020-11-05 15:40:39 -08:00
Michel Heily ebd58261ba core: sound: Use correct variable when logging new sample rates
Former-commit-id: 6f5ff96dae03b2be061bcf06a6d701fda7ca15cb
Former-commit-id: 2934a02dfd36de2e794e8861df8f5035daab3165
2020-11-05 02:37:28 +02:00
Michel Heily aaf1a71a9d android: Fix takePersistableUriPermission() error on Android 10
Used wrong Intent ACTION


Former-commit-id: 6a46248d5f9b977558b85ef4bab1939a5a08a9b3
Former-commit-id: dd086c794870474d8e4e49341bc868baae5c1696
2020-10-27 02:06:23 +02:00
Michel Heily efb1cdb4b6 core: Fix 8bit accesses to mgba log
Former-commit-id: 780e6b58b265ad5d586fe605f143e6c9d8b26c63
Former-commit-id: 5d2514c9a45d2f5c698272c9324575d7bddec4ac
2020-10-24 09:35:03 -07:00
Michel Heily fb32b9a671 core: Implement mGBA log support.
It's quite an handy way to log messages from ROMs, so I thought it'd be nice to add it.


Former-commit-id: 6869bdb58cfa883ac1ca6832f0bbeeab0edcf552
Former-commit-id: 89d7d826c7a906bbb68f9f4305bb92cd50bb2296
2020-10-24 05:59:48 -07:00
Michel Heily b28fc3108f Bump arrayvec to 0.5.2
Former-commit-id: c6fd55768ba8e1640bb46d35c76f7ccf8643bfe0
Former-commit-id: 28de793611b50a9f6fc2933d6d92543a92cc2cb1
2020-10-24 05:59:48 -07:00
Michel Heily 40e306349c core: arm7tdmi: Force address alignment in memory accesses
Fixes #148


Former-commit-id: 36f33c599cd9a3c51115bf20037bfdce9f581912
Former-commit-id: 24130ddb51ae3dff2c576289b74a8cbd7519593f
2020-10-23 01:31:58 +03:00