Commit Graph

45 Commits

Author SHA1 Message Date
8fc403cdad update copyright headers 2024-06-15 17:01:19 +02:00
043244a56d Compute shader renderer (#2041)
* nothing works yet

* don't double buffer 3D framebuffers for the GL Renderer
looks like leftovers from when 3D+2D composition was done in the frontend

* oops

* it works!

* implement display capture for compute renderer
it's actually just all stolen from the regular OpenGL renderer

* fix bad indirect call

* handle cleanup properly

* add hires rendering to the compute shader renderer

* fix UB
also misc changes to use more unsigned multiplication
also fix framebuffer resize

* correct edge filling behaviour when AA is disabled

* fix full color textures

* fix edge marking (polygon id is 6-bit not 5)
also make the code a bit nicer

* take all edge cases into account for XMin/XMax calculation

* use hires coordinate again

* stop using fixed size buffers based on scale factor in shaders
this makes shader compile times tolerable on Wintel
- beginning of the shader cache
- increase size of tile idx in workdesc to 20 bits

* apparently & is not defined on bvec4
why does this even compile on Intel and Nvidia?

* put the texture cache into it's own file

* add compute shader renderer properly to the GUI
also add option to toggle using high resolution vertex coordinates

* unbind sampler object in compute shader renderer

* fix GetRangedBitMask for 64 bit aligned 64 bits
pretty embarassing

* convert NonStupidBitfield.h back to LF only new lines

* actually adapt to latest changes

* fix stupid merge

* actually make compute shader renderer work with newest changes

* show progress on shader compilation

* remove merge leftover
2024-05-13 17:17:39 +02:00
e973236203 Refactor NDS and DSi to be objects (#1893)
* First crack at refactoring NDS and DSi into objects

- Remove all global/`static` variables in `NDS` and related classes
- Rely more on virtual dispatch when we need to pick methods at runtime
- Pass `NDS&` or `DSi&` to its constituent components where necessary
- Introduce some headers or move some definitions to break `#include` cycles

* Refactor the frontend to accommodate the core's changes

* Move up `SchedList`'s declaration

- Move it to before the components are initialized so the `map`s inside are initialized
- Fields in C++ are initialized in the order they're declared

* Fix a crash when allocating memory

* Fix JIT-free builds

* Fix GDB-free builds

* Fix Linux builds

- Explicitly qualify some member types in NDS, since they share the same name as their classes

* Remove an unnecessary template argument

- This was causing the build to fail on macOS

* Fix ARM and Android builds

* Rename `Constants.h` to `MemConstants.h`

* Add `NDS::IsRunning()`

* Use an `#include` guard instead of `#pragma once`
2023-11-28 23:16:41 +01:00
346dd4006e Move all core types into namespaces (#1886)
* Reorganize namespaces

- Most types are now moved into the `melonDS` namespace
- Only good chance to do this for a while, since a big refactor is next

* Fix the build
2023-11-25 18:32:09 +01:00
4558be0d8e Refactor the GPU to be object-oriented (#1873)
* Refactor GPU3D to be an object

- Who has two thumbs and is the sworn enemy of global state? This guy!

* Refactor GPU itself to be an object

- Wow, it's used in a lot of places
- Also introduce a new `Melon` namespace for a few classes
- I expect other classes will be moved into `Melon` over time

* Change signature of Renderer3D::SetRenderSettings

- Make it noexcept, and its argument const

* Remove some stray whitespace
2023-11-09 21:54:51 +01:00
ac38faef14 update copyright years 2023-11-04 00:21:46 +01:00
8c4e5af737 Slight polish to DMA (#1856)
* Slight polish to DMA

- Default-initialize members explicitly
- Mark some methods as const noexcept
- Initialize DMA::MRAMBurstTable to DMATiming::MRAMDummy
- Use the default destructor

* Move DMA_Timings definitions to a source file

- To ensure constant and unique addresses

* Include some extra DMA members in the savestate

* Simplify serializing the DMA table

- Extend the dummy table to 256 bytes (same length as the real ones)

* Revert the type change to DMA::DoSavestate

* Keep the MRAMBurstTable inside the DMA class, instead of using a pointer

- If we use a pointer to an external table, then we can't use it in savestates (else that external table gets overwritten)
2023-10-24 23:27:55 +02:00
7731f66e55 fix some UB 2023-08-01 03:00:41 +02:00
79dfb8dc8f Introduce Platform::Log (#1640)
* Add Platform::Log and Platform::LogLevel

* Replace most printf calls with Platform::Log calls

* Move a brace down

* Move some log entries to one Log call

- Some implementations of Log may assume a full line

* Log the MAC address as LogLevel::Info
2023-03-23 18:04:38 +01:00
35cc79787d update copyright headers 2022-01-09 02:15:50 +01:00
d20543c119 DMA timing renovation (#1207)
* make timers usable for measurement shito without being assfuckingly unreliable

* bürp

* Arisotura can you ever clean up your goddamn code

also regroup the timer code instead of having it split weirdly

* make the set-timing functions a tad less hacky

* congrats Arisotura you made an ass-enum

* add timing region tables, and separate timings for ARM9 DMA (exempt of 3c penalty)

* temp work on DMA timings, not finished

also, did you know? 'increment/reload' is also a thing for the source address

* begin work

* add some of the GBA slot/wifi timings

* complete it, I guess

* make some progress

* getting somewhere

* sdsdfs

* see, Arisotura, was it that hard? blarg.
2021-08-31 02:28:34 +02:00
436b3c4c1d update copyright year and add missing GPL headers 2021-03-12 20:07:40 +01:00
1dbe69c6be remove some debug crap 2020-12-10 18:09:11 +01:00
842379c410 harmless DMA micro optimisation 2020-11-16 17:22:34 +01:00
9772201345 remove some UB
- savestates used to read a four bytes from a single byte value
- a few unassigned variables
- some other things
- also make the ROR macro an inline function
2020-09-04 20:37:14 +02:00
43e045357f make it able to switch between DS and DSi modes 2020-06-01 20:36:30 +02:00
2327de2423 Merge commit '4b57416552ec2fa95216e2b044559f215723bf70' into melonDSi 2020-05-30 03:12:42 +02:00
83f8e11bc1 update copyright years 2020-02-14 20:18:08 +01:00
d6bbc6f0f1 tremble upon the NDMA implementation
that doesn't do much beyond getting stuck
2019-06-18 22:54:07 +02:00
841122bc51 prevent old DMA from being a shitshow. 2019-06-18 21:12:39 +02:00
b0efde8bf7 also, update copyright name 2019-01-22 15:58:29 +01:00
669247e8c8 redesign main emu loop to use timestamps instead of being a trainwreck
* cleaner code
* faster in some cases
* more accurate (on-demand compensation for timers and GPU)
* less prone to desyncs
* overall betterer
2019-01-05 05:28:58 +01:00
3dd8c7b152 finish the work on the main loop. finally fix all cases of desync I could find. also add #ifdef'd debug code to check for desyncs. 2018-12-11 15:56:34 +01:00
78d384a754 temp commit
almost done killing ARM9/ARM7 desync, f
2018-12-11 03:08:46 +01:00
b569c03884 make it fasterer 2018-12-09 01:26:51 +01:00
29bca33bc6 take it somewhere.
still need to speed it up a tad.
2018-12-09 01:17:05 +01:00
c6fb152d80 start devolving things.
also implement proper DMA timings.

will not build. don't try.
2018-12-08 22:33:41 +01:00
86dae1a25c make this other branch where we're going to actually make it usable
but it'll be a gross hack
2018-12-08 20:27:00 +01:00
172fb4876a begin work on general timing renovation. way shitty because it behaves as if caches were off, so everything will be slow as shit. 2018-12-04 17:54:10 +01:00
a9e7f8bc5b add proper support for GXFIFO stalls.
bad games that blast the GXFIFO and overflow it:
* Super Mario 64 DS
* Rayman RR2

latter seems to get its music streaming crapoed.
2018-11-23 22:21:41 +01:00
7ba32ea076 make the ARM clock shift configurable. nothing fancy there, just paving the way for DSi support later. 2018-11-07 18:38:54 +01:00
b5c39680a5 hax, finally making savestates usable
F1 to save, F2 to load. filename hardcoded for now.

shits itself:
* when the 3D engine is used
* when a debugger is used (heh)
2018-10-18 04:00:16 +02:00
de91eabf71 savestate shito: fix compile errors.
still far from being finished, so avoid using unless you want to spawn blackholes or some pretty bad shit.
2018-10-18 00:27:55 +02:00
7cbcc6c230 zlarg 2018-09-15 03:41:09 +02:00
60f24a7432 moar progress on it 2018-09-15 03:29:36 +02:00
fea7955675 fixor copyright years. 2018-09-15 02:32:13 +02:00
4afac28263 proper display FIFO emulation 2017-06-26 11:02:10 +02:00
bdac2467e7 oh well 2017-04-23 15:38:39 +02:00
1759672d14 a few attempts at optimization 2017-04-23 15:25:15 +02:00
96a3848d84 make ROM command handling accurate, remove gross DMA hack. 2017-04-11 20:21:31 +02:00
68eb4f6caf * implement missing graphics (affine BG, rotscaled bitmap sprite)
* fix potential crash upon exit
* more work on the input config UI
* misc fixes
2017-03-24 20:53:01 +01:00
08a634371a fix bug that happened when HDMA got interrupted (or any repeating DMA, for that matter) 2017-03-21 02:05:40 +01:00
2150240cbd implement some obscure DMA types 2017-03-20 22:18:35 +01:00
a56bf5c76c make timers not suck. fixes issues (Worms2 intro FMV plays at the right speed, aging cart tests get further...) 2017-03-20 17:39:42 +01:00
8a4ed8f41c reorganize repo, move shit around 2017-03-16 23:01:22 +01:00