aboutsummaryrefslogtreecommitdiff
path: root/src/DSi.h
Commit message (Collapse)AuthorAge
* Refactor `NDS` and `DSi` to be objects (#1893)Jesse Talavera-Greenberg2023-11-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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`
* Move all core types into namespaces (#1886)Jesse Talavera-Greenberg2023-11-25
| | | | | | | | * 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
* convert DSPArisotura2023-11-05
|
* convert DSi I2C and cameraArisotura2023-11-04
|
* convert AESArisotura2023-11-04
|
* update copyright yearsArisotura2023-11-04
|
* 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
* 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
* properly stop any started cameras upon reset/shutdownArisotura2022-10-02
|
* fix SCFG_MC cartridge inserted bitRSDuck2022-08-21
|
* update copyright headersArisotura2022-01-09
|
* Custom path support (#1333)Arisotura2022-01-07
| | | | | | | also including: * getting rid of shitty strings * all new, cleaner ROM handling code * base for DSi savestates * GBA slot addons (for now, memory cart)
* remove remains of SDIOFileArisotura2021-11-21
|
* NWRAM & Direct Boot (#1149)DesperateProgrammer2021-07-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * SCFG_BIOS now selects between NDS and DSi BIOS Allowing experimental direct boot. * - making NWRAM Priorities work as in the HW - fixed loading DSi stage2 Bootloader when in direct boot (should not be loaded) and might interfere with the image loaded into the (N)WRAM previously * NWRAM and SCFG Registers are now write-guarded by the corresponding SCFG_EXT7/9 Bits * removed debugging remainder * Moved NDSHeader dependent SCFG initialization into the new DSi::SetupDirectBoot function called from NDS::SetupDirectBoot when ConsoleType is DSi * removed redundant SCFG_BIOS bit checks * Set of changes from RSDuck's review * removed a forgotten comment * - removed the guarded debug outputs for NWRAM - NWRAM writes to bank and window registers now apply their write masks. - added comment on an existing TODO within the code describing, why this is OK - fixed initial NWRAM bank reset just accessing set A * NWRAM not mapped to 03... range if bit25 in SCFG_EXT is cleared * removed NWRAM write block on cleared bit25 in SCFG_EXT * changed type of iterator for MapNWRAM_x functions from s8 to int * - reduced calculations/comparisons on NWRAM write operations - changed u8 to unsigned int for an iterator MapNWRAM_x Co-authored-by: Tim Seidel <t.seidel@kts-systeme.de>
* Add PoroCYon's DSP code. (#1123)purringChaos2021-06-06
| | | | | | | | | | | | | | | * Add PoroCYon's DSP code. * Remove some teakra iles that we dont need. * make some requested changes. * move DataMemoryOffset into namespace. * use deault param. * ad the switch change * <Generic> forget about the default parameter
* update copyright year and add missing GPL headersRSDuck2021-03-12
|
* keep only one handle of the NAND file aroundRSDuck2021-01-17
|
* Merge remote-tracking branch 'upstream/slirp' into slirp-mergeNadia Holmquist Pedersen2020-07-26
|\
| * huh. all DSi files had outdated copyright yearsArisotura2020-06-05
| |
* | reconcile DSi and JIT, fastmem for x64 and WindowsRSDuck2020-06-30
|/
* remove requirement for initmem7/9.bin (but this requires augmented BIOS ↵Arisotura2020-06-02
| | | | dumps, we'll get there)
* messing aroundArisotura2019-10-20
|
* * some fixes to SD controller support, make it clear that there is no SD ↵Arisotura2019-10-19
| | | | | | | | | inserted, makes Flipnote work somewhat better * immediately clear AES busy flag when the block count is zero (occurs when loading DSi cart games) * implement NDMA start modes that have an old-DMA equivalent (except for GXFIFO mode) now it boots DSi carts!
* * add old DS BIOSes and 04004000 BIOS-switchArisotura2019-08-05
| | | | | fixes audio issues when running DS games * attempt adding other fun shit like dynamic RAM size, but that mostly went nowhere for now
* support DSi-mode cartsArisotura2019-08-04
| | | | except they need to have the DSi-mode shit encrypted
* * add SCFG_EXTArisotura2019-07-03
| | | | * quick hack to detect cartridges
* add AES, fix a bunch of bugsArisotura2019-06-19
| | | | we're getting an error screen! wee
* tremble upon the NDMA implementationArisotura2019-06-18
| | | | that doesn't do much beyond getting stuck
* take all the SDMMC shit further. now it's completing MMC init and trying to ↵Arisotura2019-06-18
| | | | read shit.
* moar SD/MMC commandsArisotura2019-06-17
|
* lay base for SD shitArisotura2019-06-16
|
* add I2C shitoArisotura2019-06-15
|
* run teh binary. BAHAHAHAHAHAHAHAAHHHHArisotura2019-06-15
| | | | it doesn't do much for now tho
* setup new-WRAM mapping. hark hark harkArisotura2019-06-15
|
* melonDSi: skeleton in placeArisotura2019-06-15
|
* add all sorts of shitArisotura2019-06-13
|
* blargArisotura2019-06-13