aboutsummaryrefslogtreecommitdiff
path: root/src/frontend
Commit message (Collapse)AuthorAge
* Work around a strange bug in Qt5 that causes melonDS to crash on launchNadia Holmquist Pedersen2023-07-16
| | | | | | | ...but only with LTO enabled ...but only on some UNIX systems ...but only with some additional build options except when it breaks without any as well
* DSi: add option to boot the full boot ROMs (#1581)PoroCYon2023-07-16
| | | | | | | | | * DSi: add option to boot the full boot ROMs added a config option for this so that this can be enabled or disabled also added IO regs for DSi GPIO, but those don't do anything yet. * reset GPIO regs on reset
* Add a fallback to streaming decompression when loading zstd-compressed ROMs.Nadia Holmquist Pedersen2023-07-14
| | | | | | Because of course some compression programs aren't nice enough to tell you the decompressed size up front in the file, so the other approach will fail. Things just can't ever be easy and straight forward, can they?
* Don't try to open the mic device every time if SDL says it has noneNadia Holmquist Pedersen2023-07-14
| | | | | Fixes the UI hanging up on Windows 11 when there are no mics, but the mic input is set to external device as it is by default.
* Modest cleanups for DSi_NAND (#1714)Jesse Talavera-Greenberg2023-07-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add a definition for TMD files * Wrap TitleMetadata in a namespace * Add a comment * Remove TitleMetadataCertificate - melonDS ignores it anyway * Refactor the use of title metadata - Move bitwise operations on the title ID into helper methods - Use TitleMetadata objects instead of pointers to raw data * Slight cleanup in DSi_NAND - Replace some constants with sizeof - Use an NDSHeader object instead of a raw array of bytes * Add a DSi_NAND::ImportFile overload that loads a file from memory * Split most of ImportTitle into InitTitleFileStructure - It will be reused in the next commit * Add ability to import title from memory * Fix another potential issue * Fix broken DSiWare installation - The bytes of the title ID/category were being swapped in most places, but not all * Add some logging calls * Declare array sizes in DSi_TMD in decimal, not hex * Add a space after the #endif - To adhere to the style guide * Assert the size of TitleMetadataContent * Change the type of SignatureName * Don't mark the TMD structs as packed * Remove extraneous comments * Cut down some newlines
* Split the cart parsing and loading steps (#1707)Jesse Talavera-Greenberg2023-06-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Split ROMList into a .cpp file - Its definition in ROMList.h was causing multiple-definition linker errors - Introduce ROMListSize, since you can't take a sizeof() of an extern declaration - Mark ROMList and ROMListSize as const * Update ReadROMParams to accommodate ROMList changes * Split parsing and loading of NDS ROMs - Introduce an NDSCartData class for parsing a ROM file - Introduce InsertROM for loading a NDS cart - Refactor LoadROM to use NDSCartData and InsertROM under the hood * Reset cart state and initialize save memory in the NDSCartData constructor - Otherwise there's no way to know about SRAM-specific attributes before inserting the game * Add a comment to NDSCartData * First crack at splitting parsing and loading for GBACart * Add some logging calls for encrypting the secure area * Log the XXH64 hash of the inserted NDS ROM * Log the XXH64 hash of the secure area after decryption * Add some logging to Key1_LoadKeyBuf * Re-encrypt the secure area when inserting the cart, not when parsing it - This way, constructing a NDSCart doesn't imply a read from the filesystem (as is done in Key1_KeyBuf) * Load Key1_KeyBuf from memory, not from the file system - Now that the cart's secure area isn't re-encrypted until insertion, we can expect that the BIOS will be ready at this point * Add some helper query methods to NDSHeader * Query the DSi region directly from the header instead of checking the ROM again * Introduce a CartType enum - So CartCommon::Type doesn't have to return magic numbers * Reset the cart in NDSCart::InsertROM instead of the NDSCartData constructor - That way the constructor doesn't rely on the config or on file I/O when loading homebrew - This keeps the use of global state closer to one place * Add non-const getters for the carts * Add InsertROM overloads that accept unique_ptrs * Fix a comment * Rename member functions on NDSCartData and GBACartData to adhere to the convention * Rename members on NDSCartData and GBACartData to adhere to the convention * Fix build errors on some platforms * Add NDSHeader::IsDSiWare * Add a ROMListEntry parameter to the cart constructors - To allow for looking up details of SRAM or expected ROM size * Add some new getters to CartCommon * Use the Header/Banner members instead of globals * Make CartCommon abstract - It's not supposed to be instantiated anyway * Change the signature of CartCommon::Checksum - It's neither overridden nor mutating * Add some clarifying comments to NDSHeader * Delete CartCommon::ROM in its destructor - ParseROM copies its input and gives that copy to the cart object, so it's okay * Add some getters to CartCommon * Refactor NDSCart - Get rid of NDSCartData - Get rid of cart-specific global state within NDSCart (so registers are untouched) - Refactor uses of removed global variables to use the Cart pointer instead - Refactor ROMInfoDialog's icon functions to accept const arguments * Return the cart pointer - So *that's* why it was crashing. Whoops - Why is this even allowed? * Refactor GBACart - Delete CartGame::ROM in the destructor - Get rid of GBACartData - Remove some global state * Mark NDSCart::CartCommon::Type as const * Slightly refactor GBACart::CartCommon - Mark Type as const - Use enum constants - Make CartCommon itself abstract * Mark CRC32's data parameter as const * Mark GBACart::CartCommon::Checksum as const * Use assert.h instead of cassert - As demanded by the style guide * Fix some includes to adhere to the style guide * Get the ARM9 entry address directly from the header object * Use more Header fields directly * Rename some parameters to match the style guide * Remove some unused includes * Slightly change NDS_Header::IsHomebrew for clarity
* Assign Qt standard Quit keyboard shortcutNadia Holmquist Pedersen2023-06-29
|
* Add microphone combobox using SDL (#1709)falsidge2023-06-27
|
* actually rename that settingNadia Holmquist Pedersen2023-06-24
|
* Add a description to the wifi settings dialogNadia Holmquist Pedersen2023-06-24
| | | | | Explains that the settings only affect online play, not local multiplayer
* Implement in-memory savestates (#1693)Jesse Talavera-Greenberg2023-06-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Refactor Savestate::Var{8,16,32,64} - They now delegate to VarArray - They're declared in the class header so they're likely to be inlined * First crack at refactoring Savestate to work in-memory - Well, third, but who's counting? * Implement Savestate::Finish * Remove the VersionMajor and VersionMinor fields - Instead, pull their values directly from the savestate buffer * Mark a new constructor as explicit * Rename Reset to Rewind * Fix a linebreak * Implement Savestate::Rewind * Add ROMManager::ClearBackupState * Refactor ROMManager to use the refactored Savestate * Capitalize "Least" - It was driving me nuts * Add a log call * Increase default Savestate buffer length to 32MB * Use C-style file I/O instead of C++-style - Dumping bytes to a file with C++'s standard library is a MONSTROUS PAIN IN THE ASS * Quote the savestate's file path for clarity * Write the savestate's length into the header * Add some extra logging calls * Fix section-loading * Remove the deprecated Savestate constructor * Convert a char* to a u32 with memcpy, not a cast * Fix section-handling in loads * Include <cstring> in Savestate.h - This was causing a build error on Linux
* disable screen filtering when drawing with QTRSDuck2023-05-06
| | | | it can bring everything to a crawl and OpenGL display can be used as an alternative
* Fix tab ordering everywhereNadia Holmquist Pedersen2023-05-01
|
* Fix the layout of the video settings dialog a bitNadia Holmquist Pedersen2023-05-01
|
* add missing GPL headerRSDuck2023-05-01
|
* fix UBRSDuck2023-05-01
|
* refactor frontend audio functionalityRSDuck2023-05-01
|
* Support loading Zstandard-compressed ROMs (#1667)Nadia Holmquist Pedersen2023-04-28
| | | | | | | This is different from the archive support in that the compressed ROMs are standalone files, rather than archives, making it possible to use them exactly as if they were regular ROMs, while saving a bunch of space on disk. This is supported both for DS and GBA ROMs, though given GBA ROMs' generally small size it's mostly useful for the former.
* pointless micro optimisationsRSDuck2023-04-28
|
* DSi power button and volume switch support (#1630)Ed_IT2023-04-04
| | | | | | | | | | | | | * Add proper BPTWL interrupts * Added DSi power button and volume switch hotkeys * Added hardware reset workaround * Adjusted syntax to follow guidelines * Added DSi output volume synchronization * Fix trivial member function error
* Allow toggling Wayland support (#1654)DarkOK2023-04-03
|
* Fixed unhandled error status for LastSep(std::string) (#1645)Sergio2023-03-25
|
* Introduce `Platform::Log` (#1640)Jesse Talavera-Greenberg2023-03-23
| | | | | | | | | | | | | * 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
* BIOS/NAND UI changes (#1587)Gloria2023-03-20
| | | | | | | | | | | | * Remember the last folder for BIOS files Add .mmc to the list of NAND filename extensions * Add .sd file extension for SD images * Fix UI code according to the review --------- Co-authored-by: yeah-its-serena <32610623+yeah-its-serena@users.noreply.github.com>
* tiny refactoring around the input config dialogRSDuck2023-03-02
|
* gotta blow harderRSDuck2023-03-02
|
* Add hotkey to toggle screen emphasisNadia Holmquist Pedersen2023-02-17
| | | | | Toggles which screen is emphasized when the screen sizing is set to emphasize top or bottom. (Closes issue #1565)
* Rebase: Make archive detection more robust and add it to the CLI (#1560)Janfel2023-01-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Rebase/recreate my changes and add MIME support This commit recreates the changes proposed in #1394 on top of the current master (b069a2acf10e58579d82500fb057f275647507c0). This also adds support for determining filetypes using the MIME database provided by `QMimeDatabase`. * Move member syntax warning to a more appropriate place * Deduplicate member syntax warning * Change warning from "vertical bars" to "|" * Conform brace placement to coding style * Fix QFileDialog filter when ArchiveExtensions is empty * Final cleanup and fixes - Changes the NDS and GBA ROM MIME-Type constants to QStrings. - Removes a leftover warning message. - Uses Type() syntax instead of Type{} syntax for temporaries. * Explain the origin of the supported archive list Co-authored-by: Jan Felix Langenbach <insert-penguin@protonmail.com>
* fix window aspect ratioRSDuck2023-01-17
|
* fix #1551RSDuck2022-11-25
|
* fix #1556RSDuck2022-11-14
|
* prevent screensaver (#1485)pepper-jelly2022-11-11
|
* Explicitly include the build/res directory so windres will find it whenNadia Holmquist Pedersen2022-11-09
| | | | using the CMake Makefile generator
* Allow import/export of .pub/.prv/.bnr saves (#1558)Pk112022-11-07
|
* Windows resource/manifest fixesNadia Holmquist Pedersen2022-11-06
| | | | | | | | * Report correct Windows architecture for the build in the manifest * Output processed .rc/.manifest in the CMake binary dir to prevent potential issues with the files conflicting if cross compiling melonDS on the same Windows machine * Make the original file name actually make sense
* Use WGL for GL context creation on Windows ARM64 as well.Nadia Holmquist Pedersen2022-11-05
| | | | | | | This may not work, as I'm not sure why the code originally did as it did. But this at least lets it compile, we'll need someone with a real Windows ARM device to test this as I only have a VM with no GPU acceleration.
* mainWindow may be nullptr when audioMute() is called.Nadia Holmquist Pedersen2022-11-05
| | | | Fixes potential crash on launch when multiplayer audio output is set to only the current window.
* CLI 2.0: Electric Boogaloo (#1546)patata2022-10-28
| | | | | | | | | | | | | | | | | | * CLI: begin QT reimplementation * Add first batch of parameters * ROM loading (no archives yet) * --fullscreen * --boot (non-functional???) * fix --boot * archives! * Add disclaimer that a.zip|b.nds is kind of fucky * remove shit7 debugging * Apply requested changes
* getWindowInfo: handle if the Wayland window handle is nullNadia Holmquist Pedersen2022-10-19
|
* No more context mess (#1531)RSDuck2022-10-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * WIP: use Duckstation's context code to directly render into QT Widget from separate thread without two OpenGL contexts currently only works on Windows * reenable gay OSD * add back vsync * make it atleast a little more thread safe * linux support * don't segfault on closing * reorganise and cleanup build system it's still not good, but better than before * macos? * try to get it working on Ubuntu CI also update instructions * let's try this * ok how about this * try creating an OGL 4.3 context first (https://i.kym-cdn.com/photos/images/original/001/264/842/220.png) * fix Ubuntu * hm * try again for Windows * let's try this * make the OpenGL renderer work again that was stupid * do OGL surface resizing from the mainthread * Fix small mistake in GL context creation on macOS causing version 3.2 to be considered invalid * C stupidness * cleanup * don't let the emuthread deinit OGL if there's no OGL * reset lastScreenWidth/Height when deiniting OpenGL * disable stencil test while drawing framebuffers * macOS: Link Cocoa framework explicitly when not building with Qt6 Seems to be needed for the classes used by DuckStation's GL context code. * Set ScreenPanelGL's minimum size immediately Fixes GL context creation for OpenGL display on macOS using the wrong size as the underlying window was not resized to the correct size by Qt yet. * don't emit window updates when OGL display is used * stuff Arisotura said Co-authored-by: Nadia Holmquist Pedersen <nadia@nhp.sh>
* Merge pull request #1282 from gal20/scale_fixNadia Holmquist Pedersen2022-10-04
|\ | | | | Fix screen scaling error
| * Fix screen scalinggal202022-01-05
| | | | | | | | | | The screen gap wasn't multiplied by the scaling factor, causing the result to be too low Additionally, results of division should be rounded up
* | add support for UYVY format (FaceTime camera)Arisotura2022-10-02
| |
* | camera: fix x-flip crustinessArisotura2022-10-02
| |
* | actual DSi camera support (#1520)Arisotura2022-10-02
| | | | | | basically feeding something that isn't a fixed stripe pattern, and emulating enough of the camera hardware to make this work
* | Account for the screen gap being scaled with the window sizeNadia Holmquist Pedersen2022-09-25
| | | | | | | | Fixes #1430
* | properly make the DSi NAND instance-uniqueArisotura2022-09-23
| |
* | remove Windows console shito we don't need anymoreArisotura2022-09-22
| |
* | merge local_wifi (#1516)Arisotura2022-09-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * attempt at betterer wifi * add preliminary sync mechanism * fix gaps in wifi implementation * move local-MP comm to its own module instead of cramping Platform.cpp * remove some stupid cruft * as you wish, Sorer (starting work on shared-memory system) * shared-memory IPC that actually works (albeit Windows-only for now) * shut up logging from NULL writes on ARM7 (ffs Nintendo learn to code) * get this somewhat good * leave client sync mode when host deauths. makes download play actually work. * start implementing MP-comm error handling * * add MP-reply error counters * feeble attempt at fixing slowdown/desync/etc problems * somewhat better exchange/sync method * * when entering power-saving mode, be sure to finish transferring the current frame first * fix misc bug due to old cruft leftover makes for a more stable connection * remove a bunch of cruft * set wifi time interval to 34 cycles instead of 33. games seem sensitive to the general timing of wifi vs the rest of the system, and this seems to make things run better, atleast until I rewrite this to use a proper scheduler. * more graceful handling of disconnects * deal with FIFO overflow more gracefully * BAHAHAHAHAHAHAHAHHHH THE SNEAKY BASTARDS so, when the DS receives a beacon with the right BSSID that beacon's timestamp is copied to USCOUNTER * attempt at making the connection process smoother for weird games * * begin adding POWCNT2, only applies to wifi for now * begin work on wifi scheduler * implement the shitty timers * add the RF wakeup thing * begin work on receiving frames. for now it can just receive melonAP beacons, but hey, it's a start. * add enough TX functionality that online wifi is a possibility again. * there are problems with this scheduler thing. committing it anyway * kind of a rollback... we're gonna work out a compromise on this, I guess * don't transmit shit if RXCNT.bit15 isn't set * move RX-finish to its own function. more accurate filtering. implement RXFILTER. * remove some cruft * fix some of the shittiness when trying to connect more than two players * fix some more shittiness * fix more wifi shittiness (mainly don't try to receive shit while sending a frame) * run wifi every 8µs. improves performance. * fix IRQ14/IRQ15 * make this work under Linux * Make it work on macOS, for now using a custom sem_timedwait implementation. If anyone knows anything about mach ports and have an idea for how to make this work using mach IPC, please do let me know. * 25ms seems like a good timeout * begin work on proper multiplayer UI shito. for now, determine a global instance ID, and derivate the system MAC from it. remove 'randomize MAC' option. * finish removing RandomizeMAC * lay groundwork for instance-unique config * work some on the UI... make it not labelled Fart * more UI work: make it explicit that some things are instance-unique * separate firmware files for multiplayer instances * make instances save to different save files, too * more UI work, make things somewhat less shitty * lay base for the multiplayer settings dialog * actually hook up most of that dialog * actually implement the fun audio settings * ensure all the wifi shit is properly savestated and reset. properly update timings for the wifi region when wifi is disabled. * add more fun labels * * ignore WEP frames if WEP is off * implement RX_LEN_CROP * fake enough of WEP processing to make Inazuma Eleven work * * do not copy more ROM banner data than actually needed * avoid trying to read out of bounds if the banner offset is bad * Fix oversight with the preferences action causing the build to fail on macOS Co-authored-by: Nadia Holmquist Pedersen <nadia@nhp.sh>
* | lol oopsNadia Holmquist Pedersen2022-09-18
| |