aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
...
* Use Platform::File calls in NDS::debug (#1888)Jesse Talavera-Greenberg2023-11-24
|
* Add support for saving animated iconsRayyan Ansari2023-11-23
| | | | | Add support for exporting animated DSi icons as GIF using the header-only gif.h library.
* Refactor the JIT to be object-oriented (#1879)Jesse Talavera-Greenberg2023-11-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* fix forgotten <array> includeNadia Holmquist Pedersen2023-11-15
|
* DSi_Camera: fix gcc-14 build issueorbea2023-11-11
| | | | | | melonDS/src/DSi_Camera.cpp:190:23: error: 'clamp' is not a member of 'std' 190 | r1 = std::clamp(r1, 0, 255); g1 = std::clamp(g1, 0, 255); b1 = std::clamp(b1, 0, 255); | ^~~~~
* Refactor the GPU to be object-oriented (#1873)Jesse Talavera-Greenberg2023-11-09
| | | | | | | | | | | | | | | | | * 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 (#1871)Jesse Talavera-Greenberg2023-11-09
| | | | | | | | | | | | | | | | | | * 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
* Make AREngine::RunCheat public (#1872)Jesse Talavera-Greenberg2023-11-08
| | | | | - 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
* Move GBACart-related global state into objects (#1870)Jesse Talavera-Greenberg2023-11-08
| | | | | - 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 caused by change to front face polygon culling (#1820)Jaklyy2023-11-07
| | | | | | | | | * 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.
* Also exclude .note.GNU-stack section on Windows arm64Nadia Holmquist Pedersen2023-11-07
|
* ArchiveUtil: use signed return type instead of unsignedRayyan Ansari2023-11-06
| | | | | | | | 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.
* Fix some memory leaksRayyan Ansari2023-11-06
| | | | | | 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.
* ROMManager: initialise filedata to nullptrRayyan Ansari2023-11-05
| | | | | | | | | 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.
* CameraManager: wait for camera to be loadedRayyan Ansari2023-11-05
| | | | | | | | | | | | | | | 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.)
* fuck every aspect of thisArisotura2023-11-05
|
* convert DSPArisotura2023-11-05
|
* convert DSi I2C and cameraArisotura2023-11-04
|
* convert AESArisotura2023-11-04
|
* convert AREngineArisotura2023-11-04
|
* convert Wifi and WifiAPArisotura2023-11-04
|
* convert SPU to OOPArisotura2023-11-04
|
* update copyright yearsArisotura2023-11-04
|
* hopefully get the compiler to shut upArisotura2023-11-03
|
* convert RTC to OOPArisotura2023-11-03
|
* get this started: refactor SPI in OOPArisotura2023-11-03
|
* better, less hacky, more OOP-friendly scheduler designArisotura2023-11-02
|
* better be safe than sorryArisotura2023-11-02
|
* fix weird hang when returning to the DSi menuArisotura2023-11-02
|
* make linebreaks in text files not weirdArisotura2023-11-02
|
* RTC: add the DSi alarm expansion registersArisotura2023-11-02
|
* Fix compilation with the GDB stub disabled (#1863)Jesse Talavera-Greenberg2023-11-01
|
* minor cleanupArisotura2023-11-01
|
* use a grid layout in the date/time dialog so Qt will behaveNadia Holmquist Pedersen2023-10-30
|
* fdsfdArisotura2023-10-30
|
* RTC revamp (#1867)Arisotura2023-10-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Miscellaneous DSi NAND fixes (#1852)Jesse Talavera-Greenberg2023-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | * 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 (#1856)Jesse Talavera-Greenberg2023-10-24
| | | | | | | | | | | | | | | | | | | | | | | | * 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)
* GDB stub (#1583)PoroCYon2023-10-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* store pc+12 when storing r15RSDuck2023-10-22
|
* Refactor DSi_NAND (#1844)Jesse Talavera-Greenberg2023-10-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Add some structs for files that DSi_NAND reads (#1842)Jesse Talavera-Greenberg2023-10-02
| | | | | | | | | | | | | | | | | | | * Add DSiFirmwareSystemSettings * Replace DSiFirmwareSystemSettings::TouchCalibration fields with std::arrays - So assignment can be done in one line * Make DSiFirmwareSystemSettings a union - So its bytes can be accessed * Add a comment * Use DSiFirmwareSystemSettings instead of raw byte offsets * Add definitions for DSiSerialData and DSiHardwareInfoN * Move DSiFirmwareSystemSettings's hash update logic into its own method
* Replace DSi_NAND's uses of sprintf with snprintf (#1841)Jesse Talavera-Greenberg2023-10-01
| | | - Now clang oughta stop complaining
* Wrap CurGLCompositor cleanup in an #ifdef (#1837)Jesse Talavera-Greenberg2023-09-24
|
* Clean up some rendering-related resources in DeInit (#1836)Jesse Talavera-Greenberg2023-09-24
| | | - The unique_ptr destructors will take care of the cleanup
* Ensure that the new firmware is installed when resetting (#1834)Jesse Talavera-Greenberg2023-09-21
| | | - It might have been changed in the settings
* only recalculate extended access point checksum when firmware is a DSi oneRSDuck2023-09-20
|
* Refactor the core's handling of firmware and BIOS images to rely less on the ↵Jesse Talavera-Greenberg2023-09-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | file system (#1826) * Introduce firmware-related structs * Fix some indents * Move the generated firmware identifier to a constant * Document the WifiAccessPoint constructors * Add some constants * Remove a stray comment * Implement Firmware::UserData * Add Firmware::Mask * Document Firmware::Buffer * Add a Firmware constructor that uses a FileHandle * Set the default username in UserData * Update the UserData checksum * Forgot to include Platform.h * Remove some redundant assignments in the default Firmware constructor * const-ify CRC16 * Replace the plain Firmware buffer with a Firmware object - Remove some functions that were reimplemented in the Firmware constructors * Fix some crashes due to undefined behavior * Fix the user data initialization - Initialize both user data objects to default - Set both user data objects to the same touch screen calibration * Follow the DS logic in determining which user data section is current * Remove an unneeded include * Remove another unneeded include * Initialize FirmwareMask in Firmware::Firmware * Use the DEFAULT_SSID constant * Add SPI_Firmware::InstallFirmware and SPI_Firmware::RemoveFirmware * Move a logging call to after the file is written * Add a SaveManager for the firmware * Touch up the SPI_Firmware::Firmware declaration * Move all firmware loading and customization to the frontend * Call Platform::WriteFirmware when it's time to write the firmware back to disk * Fix some missing stuff * Remove the Get* functions from SPI_Firmware in favor of GetFirmware() * Implement SPI_Firmware::DeInit in terms of RemoveFirmware * Add Firmware::UpdateChecksums * Fix an incorrect length * Update all checksums in the firmware after setting touch screen calibration data * Use the Firmware object's Position methods * Remove register fields from the Firmware object * Install the firmware before seeing if direct boot is necessary * Install the firmware before calling NDS::Reset in LoadROM * Slight cleanup in ROMManager * Fix the default access point name * Shorten the various getters in Firmware * Add qualifiers for certain uses of firmware types - GCC can get picky if -fpermissive isn't defined * Add an InstallFirmware overload that takes a unique_ptr * Log when firmware is added or removed * Don't clear the firmware in SPI_Firmware::Init - The original code didn't, it just set the pointer to nullptr * Fix a typo * Write back the full firmware if it's not generated * Move the FreeBIOS to an external file * Load wfcsettings.bin into the correct part of the generated firmware blob * Load BIOS files in the frontend, not in the core * Fix logging the firmware ID * Add some utility functions * Mark Firmware's constructors as explicit * Remove obsolete ConfigEntry values * Include <locale> explicitly in ROMManager * Fix up some includes * Add Firmware::IsBootable() * Add a newline to a log entry - Whoops * Log the number of bytes written out in SaveManager * Mark FirmwareHeader's constructor as explicit * Clean up GenerateDefaultFirmware and LoadFirmwareFromFile - Now they return a pair instead of two by-ref values * Refactor SaveManager a little bit - Manage its buffers as unique_ptrs to mitigate leaks - Reallocate the internal buffer if SetPath is asked to reload the file (and the new length is different) * Remove some stray parens * Fix some firmware-related bugs I introduced - Firmware settings are now properly saved to disk (beforehand I misunderstood when the firmware blob was written) - Firmware is no longer overwritten by contents of wfcsettings.bin * Slight cleanup
* Make the NDS teardown more robust (#1798)Jesse Talavera-Greenberg2023-09-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* fix last commitRSDuck2023-09-02
|