* Give `GPU2D::Unit` a virtual destructor
- Undefined behavior avoided!
* Add an `array2d` alias
* Move various parts of `GPU2D::SoftRenderer` to `constexpr`
- `SoftRenderer::MosaicTable` is now initialized at compile-time
- Most of the `SoftRenderer::Color*` functions are now `constexpr`
- The aforementioned functions are used with a constant value in at least one place, so they'll be at least partially computed at compile-time
* Generalize `GLRenderer::PrepareCaptureFrame`
- Declare it in the base `Renderer3D` class, but make it empty
* Remove unneeded `virtual` specifiers
* Store `Framebuffer`'s memory in `unique_ptr`s
- Reduce the risk of leaks this way
* Clean up how `GLCompositor` is initialized
- Return it as an `std::optional` instead of a `std::unique_ptr`
- Make `GLCompositor` movable
- Replace `GLCompositor`'s plain arrays with `std::array` to simplify moving
* Pass `GPU` to `GLCompositor`'s important functions instead of passing it to the constructor
* Move `GLCompositor` to be a field within `GLRenderer`
- Some methods were moved up and made `virtual`
* Fix some linker errors
* Set the renderer in the frontend
* Remove unneeded `virtual` specifiers
* Remove `RenderSettings` in favor of just exposing the relevant member variables
* Update the frontend to accommodate the core changes
* Add `constexpr` and `const` to places in the interpolator
* Qualify references to `size_t`
* Construct the `optional` directly instead of using `make_optional`
- It makes the Linux build choke
- I think it's because `GLCompositor`'s constructor is `private`
* 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`
* 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
* Move TinyVector to a new file
- So it's less sensitive to #include ordering
* Forgot to include assert.h
* Refactor ARMJIT_Memory into an object
* Oops, forgot a declaration
* Refactor ARMJIT to be contained in an object
* Remove an unused function declaration
* Add a missing #include
* Remove a now-unused global
* Use ARMJIT_Memory's own memory access functions
* Fix some omissions in the ARM JIT
* Move libandroid to be a member of ARMJIT_Memory instead of a global
* Default-initialize most fields in ARMJIT_Compiler.h
* Define NOOP_IF_NO_JIT
* Finish refactoring the JIT to be object-oriented
* 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
* Move NDSCart-related global state into objects
- RAII will now do the heavy lifting
- Mark some methods as const or noexcept
* Move GBACart-related global state into objects (#1870)
- RAII will now do the heavy lifting
- Mark some methods as const or noexcept
- Once the `NDS` object is finalized, most of these `assert`s can go away
* Make AREngine::RunCheat public (#1872)
- I use it directly in melonDS DS to apply single cheats without using ARCodeFile
- Before the AREngine refactor I could just redeclare the function in my code
- Now I can't
- I use it directly in melonDS DS to apply single cheats without using ARCodeFile
- Before the AREngine refactor I could just redeclare the function in my code
- Now I can't
- RAII will now do the heavy lifting
- Mark some methods as const or noexcept
- Once the `NDS` object is finalized, most of these `assert`s can go away
* fix regression with facing view
Only the check for a polygon being counter-clockwise is supposed to be <=
* only use dot < 0 for 'cull front face' polygons
this is the fix.
The ExtractFileFromArchive function can sometimes return -1 on error,
however the function's return type was specified as u32, which would
mean that it would instead be represented as the maximum value.
Change the function's return type to the signed s32 instead, and
correct uses.
Free some objects that were allocated with new but not deleted, and in
one case, do not set a pointer to nullptr before deleting, as this
results in a memory leak due to memory allocated not being freed.
If a user manages to open a file as a ROM that is greater than 1 GiB,
it will cause a segmentation fault (a crash) in LoadROM due to a delete
being called on an uninitialised pointer, which is undefined behaviour.
Initialise filedata to nullptr to prevent this, as deleting a null
pointer is defined as a no-op.
In QCamera in Qt 5, the camera is required to have been loaded before
querying its settings and resolutions. Doing so without loading being
finished would result in the returned list being empty.
See https://doc.qt.io/qt-5.15/qcamera.html#supportedViewfinderSettings
Add a QEventLoop that waits for the state to change from Loading to
Loaded before supportedViewfinderSettings() is called to ensure that
valid information is returned.
(Fixes my camera being blank in preview, same issue also presumed
to occur when camera is needed in game, fix tested on a USB camera on
a Linux system and Qt 5.)
* 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
* Replace some standard I/O calls with Platform equivalents
- I missed a spot when I submitted that PR a few months ago
* Include <memory> in DSi_NAND.h
- Because it uses unique_ptr
* Split DSi_NAND::ReadHardwareInfo into ReadSerialData and ReadHardwareInfoN
* Add a RegionMask enum
* Move DSi NAND patching to the frontend
* Add DSiSupportedLanguageMask
- Not currently used by the frontend, but I use it in melonDS DS
* Remove some Platform::ConfigEntry values
- The core no longer needs to know about them
- The corresponding Config values are unchanged
* Mark NANDMount's destructor as noexcept
* 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)
* gdbstub beginnings
* gdbstub: finish gdb impl things, next up is integration with melonDS
* holy fuck the gdbstub works
* gdb breakpoints work, but there's a mysterious crash on continue
* fix memory corruption that sometimes happened, and make resetting the console thru gdb work
* remove some gdb debug printing
* fix things in gdbstub
* separate option for enabling gdbstub
* add mode-dependent CPU registers
* C++ize the GDBstub code
* add gdbstub config in emu settings dialog
* make sure gdb is disabled when jit is enabled
* Remove unnecessary compiler flags, mark ARMJIT assembly code as no-execute-stack
This hardens the binary a little bit against common exploitation methods
* add option to wait for debugger attach on startup
* only insert GNU stack notes on linux
* disable gdbstub enable checkbox when jit is enabled
* fix non-linux incompatibilities
* enable gdbstub by default
* fix issues with gdbstub settings disable stuff
* format stuff
* update gdb test code
* Fix segfault when calling StubCallbacks->GetCPU()
C++ overrides are hard. Please I'm just a lowly C programmer.
* fix packet size not being sent correctly
Thanks to @GlowingUmbreon on Github for troubleshooting this
* fix select(2) calls (i should read docs more properly)
* fix GDB command sequencing/parsing issue (hopefully)
* [GDB] implement no-ack mode
* fix sending ack on handshake
* get lldb to work
* Refactor diskio's contents
- Change ff_disk_read_cb/write_cb into a std::function instead of a raw pointer
- Add const specifiers as needed
* Refactor DSi_NAND to manage the file system's mounted lifetime with RAII
* Split NANDMount into NANDMount and NANDImage
- NANDImage is used for information about the NAND that doesn't require decryption or filesystem access
- NANDMount is used to actually access the file system
- Both classes manage their respective resources (the NAND file handle and the NAND's mount) with RAII
- Also split the file loading into another function that I will remove in a later PR
* Make NANDMount immovable
* Remove NAND-loading code that I had sectioned off into a function
- Incomplete copypasta
- I must have gotten distracted
* Tidy up NANDImage's initialization
- Don't unmount the disk image if the constructor fails (that's NANDMount's job now)
- Only assign CurFile if the constructor succeeds
* Add some const-correctness
* Move DSi NAND initialization to the frontend
- The NANDImage is now installed via a unique_ptr in DSi
* Remove Platform::DSi_NANDPath
- Not Config::DSiNANDPath; that can still be configured as usual
- The core no longer needs to care