Commit Graph

81 Commits

Author SHA1 Message Date
ac38faef14 update copyright years 2023-11-04 00:21:46 +01:00
70c6750561 better, less hacky, more OOP-friendly scheduler design 2023-11-02 21:04:09 +01:00
9a450f5f28 RTC revamp (#1867)
* get this started

* implement DSi RTC commands

* set up RTC clock timer. lay down basic idea of a clock.

* make the date/time registers writable

* move RTC state to its own structure, to make it easier to deal with

* more RTC work
lay base for date/time dialog

* get the bulk of the RTC functionality going

* much simpler design for RTC stuff

* aha, that is what it is

* start working on the RTC IRQ

* implement all types of RTC IRQ

* start refining sleep mode. code still kinda sucks.

* implement keypad IRQ

* refine it some more

* shut the fuck uuuuuupppppppppppppp
2023-10-30 18:37:49 +01:00
f8fdc77e43 Wrap CurGLCompositor cleanup in an #ifdef (#1837) 2023-09-24 18:48:37 +02:00
9d9ba83731 Clean up some rendering-related resources in DeInit (#1836)
- The unique_ptr destructors will take care of the cleanup
2023-09-24 18:33:14 +02:00
db963aa002 Make the NDS teardown more robust (#1798)
* Make cleanup a little more robust to mitigate undefined behavior

- Add some null checks before cleaning up the GPU3D renderer
- Make sure that all deleted objects are null
- Move cleanup logic out of an assert call
- Note that deleting a null pointer is a no-op, so there's no need to check for null beforehand
- Use RAII for GLCompositor instead of Init/DeInit methods

* Replace a DeInit call that I missed

* Make ARMJIT_Memory less likely to generate errors

- Set FastMem7/9Start to nullptr at the end
- Only close and unmap the file if it's initialized

* Make Renderer3D manage its resources with RAII

* Don't try to deallocate frontend resources that aren't loaded

* Make ARMJIT_Memory::DeInit more robust on the Switch

* Reset MemoryFile on Windows to INVALID_HANDLE_VALUE, not nullptr

- There is a difference

* Don't explicitly store a Valid state in GLCompositor or the 3D renderers

- Instead, create them with static methods while making the actual constructors private

* Make initialization of OpenGL resources fail if OpenGL isn't loaded

* assert that OpenGL is loaded instead of returning failure
2023-09-15 15:31:05 +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
ce68e883c4 for all people who hate speed, here you can build melonDS again 2022-08-22 00:44:48 +02:00
32609bbc98 invalidate JIT blocks in ARM7 WVRAM when it's remapped 2022-08-22 00:39:08 +02:00
0feed13cc4 close gaps in VRAM mapping 2022-04-09 19:40:35 +02:00
35cc79787d update copyright headers 2022-01-09 02:15:50 +01:00
f792d3e6a1 handle changed VCount+threaded rasteriser more gracefully 2021-08-04 14:21:45 +02:00
2ff065e5ea Fix some compiler warnings 2021-05-03 13:40:44 +01:00
436b3c4c1d update copyright year and add missing GPL headers 2021-03-12 20:07:40 +01:00
41dd448e28 call Renderer2D::VBlankEnd at vblank end
instead of vblank start
2021-03-01 04:06:11 +01:00
a046eb5038 separate GPU2D registers and renderer 2021-02-27 22:25:42 +01:00
58dd1ec580 directly set VRAMDirty for VRAM BG/OAM writes 2021-02-23 02:09:18 +01:00
a7029aebae Allow for a more modular renderer backends (#990)
* Draft GPU3D renderer modularization

* Update sources C++ standard to C++17

The top-level `CMakeLists.txt` is already using the C++17 standard.

* Move GLCompositor into class type

Some other misc fixes to push towards better modularity

* Make renderer-implementation types move-only

These types are going to be holding onto handles
of GPU-side resources and shouldn't ever be copied around.

* Fix OSX: Remove 'register' storage class specifier

`register` has been removed in C++17...
But this keyword hasn't done anything in years anyways.

OSX builds consider this "warning" an error and it
stops the whole build.

* Add RestartFrame to Renderer3D interface

* Move Accelerated property to Renderer3D interface

There are points in the code base where we do:
`renderer != 0` to know if we are feeding
an openGL renderer. Rather than that we can instead just have this be
a property of the renderer itself.
With this pattern a renderer can just say how it wants its data to come
in rather than have everyone know that they're talking to an OpenGL
renderer.

* Remove Accelerated flag from GPU

* Move 2D_Soft interface in separate header

Also make the current 2D engine an "owned" unique_ptr.

* Update alignment attribute to standard alignas

Uses standardized `alignas` rather than compiler-specific
attributes.

https://en.cppreference.com/w/cpp/language/alignas

* Fix Clang: alignas specifier

Alignment must be specified before the array to align the entire array.

https://en.cppreference.com/w/cpp/language/alignas

* Converted Renderer3D Accelerated to variable

This flag is checked a lot during scanline rasterization. So rather
than having an expensive vtable-lookup call during mainline rendering
code, it is now a public constant bool type that is written to only once
during Renderer3D initialization.
2021-02-09 23:38:51 +01:00
6256a42e00 improve and fix NonStupidBitfield also get rid of some UB
fixes optimised lto clang build
2021-02-09 19:24:57 +01:00
4a28068295 the rasteriser doesn't have to be done on line 144
thanks to the VRAM cache
2021-01-26 19:05:21 +01:00
b78bc4cb66 fixes to the threadedness of the sw rasteriser
also fix #639 and fix #880
2021-01-26 16:42:27 +01:00
43348210f9 Fix some compiler warnings 2021-01-25 14:12:13 +00:00
7081c2de65 readd vram invalidation through display capture
also remove stray printf
2021-01-07 22:39:36 +01:00
e311eea1c5 fix out of bounds read 2021-01-07 18:36:49 +01:00
0f353e0d5f add palette and OAM dirty flag
currently not used anywhere
2020-12-23 09:23:46 +01:00
b6de3cc638 VRAM dirty tracking fix reset/savestate load 2020-12-09 20:10:44 +01:00
d2cfd71c32 rename the class as well
this is getting emberassing
2020-12-07 18:45:50 +01:00
b80d5a04f3 lay base for multiple GPU2D backends 2020-12-06 17:40:16 +01:00
6e8bac3909 Merge vram dirty tracking
Squashed commit of the following:

commit b463a05d4b909372f0cd1ad91caa0c77a25e5901
Author: RSDuck <rsduck@users.noreply.github.com>
Date:   Mon Nov 30 01:55:35 2020 +0100

    minor fix

commit ce73cebbdf5da243d7ebade82d8799ded9cd6b28
Author: RSDuck <rsduck@users.noreply.github.com>
Date:   Mon Nov 30 00:43:08 2020 +0100

    fix dirty flags of BG/OBJ mappings not being reset

commit fc5d73a6178e3adc444398bdd23de8314b5ca8f8
Author: RSDuck <rsduck@users.noreply.github.com>
Date:   Mon Nov 30 00:11:13 2020 +0100

    use flat vram for gpu2d everywhere

commit 34ee9fe2bf04fcfa2a5a1c8d78d70007e606f1a2
Author: RSDuck <rsduck@users.noreply.github.com>
Date:   Sat Nov 28 19:10:34 2020 +0100

    mark VRAM dirty for display capture

commit e8778fa2f429c6df0eece19d6a5ee83ae23a0cf4
Author: RSDuck <rsduck@users.noreply.github.com>
Date:   Sat Nov 28 18:59:31 2020 +0100

    use flat VRAM for textures and texpals
    also skip rendering if nothing changed and a bunch of fixes

commit 53f2041e2e1a28b35702a2ed51de885c36689f71
Author: RSDuck <rsduck@users.noreply.github.com>
Date:   Fri Nov 27 18:29:56 2020 +0100

    use vram dirty tracking for extpals
    also preparations to take this further

commit 4cdfa329e95aed26d3b21319c8fd86a04abf20f7
Author: RSDuck <rsduck@users.noreply.github.com>
Date:   Mon Nov 16 23:32:22 2020 +0100

    VRAM dirty tracking
2020-11-30 19:49:18 +01:00
6977302403 make OpenGL renderer a build option
mostly meant for the Switch port
2020-10-01 00:01:05 +02:00
b62d90cbe4 Merge remote-tracking branch 'remotes/origin/master' into melonDSi 2020-05-30 03:19:20 +02:00
2327de2423 Merge commit '4b57416552ec2fa95216e2b044559f215723bf70' into melonDSi 2020-05-30 03:12:42 +02:00
5eb01f1f15 begin renovating melonDSi 2020-05-30 02:40:51 +02:00
2912a07b8b fix bugs, clean up some of the shit 2020-05-28 17:00:25 +02:00
0804ab3c78 * rework GPU's settings interface, make it config-agnostic
* make video settings dialog functional, sorta
* fix dialogs that were resizable
2020-05-28 15:53:32 +02:00
36f4cdbbbf get the OpenGL renderer going.
sorta.

(also make the blackmagic_II branch obsolete in the process)
2020-05-25 18:25:50 +02:00
85a6a5bb38 * add support for a bunch of codes (all of them minus the loop shit, really)
* hook it betterer so it doesn't asplode
2020-02-14 23:34:26 +01:00
83f8e11bc1 update copyright years 2020-02-14 20:18:08 +01:00
106b9a6f24 lay base for AR cheatzorz. baahahhhh 2020-02-14 19:26:52 +01:00
22f3cae067 fix potential out-of-bounds write 2019-07-13 02:54:14 +02:00
000aa1f327 add LCD init flag in DISPSTAT 2019-06-20 02:31:46 +02:00
d28035674a GPU2D: hardware renders sprites one scanline in advance.
fixes #375 (midframe OAM update)
2019-06-10 03:05:26 +02:00
434a3007e2 fasterer BG/OBJ VRAM reads 2019-06-09 16:06:01 +02:00
bc53ff35a9 this is the same thing, but, for the sake of consistency 2019-06-08 12:39:52 +02:00
9ed1dda9ca fix possible crash 2019-05-25 19:52:56 +02:00
70a3243714 simpler GPU-compositing. will make it easier to grab neighbor 2D/3D pixels individually for filtering. 2019-05-25 19:36:47 +02:00
0bb3321262 getting somewhere?? 2019-05-24 02:29:16 +02:00
db396e992b welp.
progress
2019-05-21 22:28:46 +02:00
50cc38d781 botch more code 2019-05-19 19:47:23 +02:00
f5a7cb71fd also, do master brightness 2019-05-18 01:42:50 +02:00