aboutsummaryrefslogtreecommitdiff
path: root/src/NDS.cpp
Commit message (Collapse)AuthorAge
* 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>
* shut up DSi-IO warningsArisotura2021-07-17
|
* only recalculate GBA slot timing if necessaryRSDuck2021-06-27
|
* Use printf format macro hereWaluigiWare642021-06-07
|
* PRIu64 requires inttypes.h to be includedRSDuck2021-06-05
|
* Implement NO$GBA debug registers. (#1110)Pedro2021-05-27
| | | | | | | | | | | | | | | * Implement NO$GBA debug registers. NO$GBA comes with 4 debug registers that allow a ROM to print text to the emulator terminal and 2 other status registers, one with the name of the emulator and the other with the clock cycles count. This commit implements them for the ARMv5 processor. Some small things to note: - `NocashPrint` was changed and now it takes an address to _the string_ instead of the flags before it (those don't do anything anyways). - The "Emulation ID" register contains the string "melonDS " followed by version, _not_ "NO$GBA" * Fix styling issue and improve comment regarding NO$GBA message flags
* GBACart: simulate open-bus decay roughly. fixes #1093Arisotura2021-05-04
|
* Fix some compiler warningsWaluigiWare642021-05-03
|
* Cart refactor (#1073)Arisotura2021-04-25
| | | complete cart-interface refactor, will make this code a lot easier to deal with
* update copyright year and add missing GPL headersRSDuck2021-03-12
|
* separate GPU2D registers and rendererRSDuck2021-02-27
|
* Fix edge case in the division engine, fix edge case in the CPU (#1003)wheremyfoodat2021-02-19
| | | | | | | * Fixed division edge case: Div64/32 and Div64/64 set the remainder to 0 if dividend == INT64_MIN && divisor == -1 * Fixed CPU edge case where ARM9 ALU ops would switch to Thumb even when they shouldn't * Only clear the lowest bit of the jump address in ALU ops with rd==15 (on recommendation of RSDuck)
* Allow for a more modular renderer backends (#990)Wunk2021-02-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* fixes to the threadedness of the sw rasteriserRSDuck2021-01-26
| | | | also fix #639 and fix #880
* Polish up archive support (#930)Madhav Kanbur2021-01-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix directory path when extracting from archive * Don't create new dir in execution dir of melonds * Create it beside the archive instead Signed-off-by: Madhav Kanbur <abcdjdj@gmail.com> * ArchiveUtil : Use QT functions for I/O * Make it more platform independent, cleaner * Fixes permission related crash on linux Signed-off-by: Madhav Kanbur <abcdjdj@gmail.com> * NDSCart : Abstract out common code in LoadROM() Signed-off-by: Madhav Kanbur <abcdjdj@gmail.com> * Extract nds roms to memory * Some stuff is still broken in the frontend Signed-off-by: Madhav Kanbur <abcdjdj@gmail.com> * GBACart : Abstract out common code in LoadROM() Signed-off-by: Madhav Kanbur <abcdjdj@gmail.com> * Extract gba roms to memory Signed-off-by: Madhav Kanbur <abcdjdj@gmail.com> * Integrate archive support with recent files Signed-off-by: Madhav Kanbur <abcdjdj@gmail.com> * onClickRecentFile : Pause emu thread conditionally * Don't pause at start of the function * If user opens an archive and hits cancel, it won't pause Signed-off-by: Madhav Kanbur <abcdjdj@gmail.com> * Handle Resets when loading from archives * Ask user to pick the rom(s) again (i.e. GBA & NDS) when there are multiple files in the archive(s) * Directly load if only 1 file Signed-off-by: Madhav Kanbur <abcdjdj@gmail.com> * Archive support for drag-n-drop * Also recent files support for drag-n-drop Signed-off-by: Madhav Kanbur <abcdjdj@gmail.com> * main : Allocate rombuffer objects on stack * Less messy, decreases chances of memory leaks * Underlying implementation of qbytearray uses heap (hopefully?) Signed-off-by: Madhav Kanbur <abcdjdj@gmail.com> * GetSavestateName : Archive support * Construct ssname from srampath (since rompath has archive name) NOTE: In general, archive name != rom file name !!!!!!!!!! Signed-off-by: Madhav Kanbur <abcdjdj@gmail.com> * Add srl and dsi as "direct-load" formats * Direct-load = anything not in an archive Signed-off-by: Madhav Kanbur <abcdjdj@gmail.com> * Don't use static functions Signed-off-by: Madhav Kanbur <abcdjdj@gmail.com> * Remove QT stuff from Util_ROM * Also, during reset, directly load file from archive (no rom picker) Signed-off-by: Madhav Kanbur <abcdjdj@gmail.com> * Remove QT includes from FrontendUtil.h Signed-off-by: Madhav Kanbur <abcdjdj@gmail.com> * Util_ROM/LoadROM() : Use SetupDSiNAND() Signed-off-by: Madhav Kanbur <abcdjdj@gmail.com> * Util_ROM/Reset() : Use strrchr() Signed-off-by: Madhav Kanbur <abcdjdj@gmail.com> * Util_ROM : Put Archive stuff behind ifdefs Signed-off-by: Madhav Kanbur <abcdjdj@gmail.com> * main: Set parent widget for archive dialog boxes Signed-off-by: Madhav Kanbur <abcdjdj@gmail.com> * Revert "Util_ROM/Reset() : Use strrchr()" This reverts commit c8af6f066f6aa15e5557e478417edb125cad0809.
* Implement "lag frame" flag and counter (#949)SuuperW2021-01-21
| | | | | * Implement "lag frame" flag and counter, and expose flag and both frame counters. BizHawk wants these. * Track frame count and lag frames while the system isn't running.
* Improved SRAM performance (#925)Kimmy Andersson2021-01-09
| | | | | | | | | * Offload NDS SRAM writing to separate thread, debounce writes to two seconds after last flush or DeInit. * Fixed printf messages. * Fixes after CR. * Fixed potential portability issue with time_t
* make FIFO size static whene possibleRSDuck2020-12-30
|
* add palette and OAM dirty flagRSDuck2020-12-23
| | | | currently not used anywhere
* don't axe error bits when writing to IPCFIFOCNT. fixes #801Arisotura2020-12-11
|
* remove some debug crapArisotura2020-12-10
|
* Merge remote-tracking branch 'remotes/origin/master' into dsi_cameraArisotura2020-12-04
|\
| * fix DSi mode with interpreterRSDuck2020-11-26
| | | | | | | | I'm so stupid
| * harmless DMA micro optimisationRSDuck2020-11-16
| |
| * prevent use after freeRSDuck2020-11-16
| |
| * make audio output thread safe(r?)RSDuck2020-11-15
| |
| * delay savefile flush to the end of the frameRSDuck2020-11-11
| |
| * Added 8/16-bit IPCFIFOSEND writesHypnotron2020-10-29
| |
* | fix to timers (ZXDS no longer runs slow as shit)Arisotura2020-10-27
| |
* | Merge branch 'master' into dsi_cameraArisotura2020-10-26
|\| | | | | | | | | # Conflicts: # src/DSi_I2C.cpp
| * add a few missing 32bit I/O accesses (IPC, SPI)Arisotura2020-10-25
| |
| * add functionality to import savefilesRSDuck2020-09-11
| |
| * remove some UBRSDuck2020-09-04
| | | | | | | | | | | | | | - savestates used to read a four bytes from a single byte value - a few unassigned variables - some other things - also make the ROR macro an inline function
* | messin' aroundArisotura2020-09-08
|/
* actually add DLDI. bahahahhhArisotura2020-09-03
|
* Fix a typoqeeg2020-08-31
|
* DSi: make ARM9-clock-selector actually workArisotura2020-08-17
|
* check DSi interrupts for halted processor wakeupRSDuck2020-07-27
|
* Merge remote-tracking branch 'upstream/slirp' into slirp-mergeNadia Holmquist Pedersen2020-07-26
|\
| * * take nwifi forward someArisotura2020-06-15
| | | | | | | | | | * shut up CP15 printf's for Fx0 * fix bugs
* | fix build with JIT disabledRSDuck2020-07-25
| | | | | | | | fixes #675 and #674
* | SPU: delay channel start until whenever it can actually start. fixes maxmod ↵Arisotura2020-07-23
| | | | | | | | interpolated mode.
* | make linux work and fix a few bugsRSDuck2020-07-04
| |
* | reconcile DSi and JIT, fastmem for x64 and WindowsRSDuck2020-06-30
| |
* | first steps in bringing over the JIT refactor/fastmemRSDuck2020-06-16
| |
* | Merge branch 'generic_jit' of https://github.com/Arisotura/melonDS into ↵RSDuck2020-06-16
|\ \ | | | | | | | | | generic_jit
| * | rewrite JIT memory emulationRSDuck2020-06-16
| | |
| * | integrate changes from ARM64 backend and moreRSDuck2020-06-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | - better handle LDM/STM in reg alloc - unify Halted and IRQ in anticipation for branch inlining - literal optimisations can be disabled in gui - jit blocks follow simple returns - fix idle loop detection - break jit blocks on IRQ (fixes saving in Pokemon White)
| * | new block cache and much more...RSDuck2020-06-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | - more reliable code invalidation detection - blocks aren't stopped at any branch, but are being followed if possible to get larger blocks - idle loop recognition - optimised literal loads, load/store cycle counting and loads/stores from constant addresses
| * | fix uninitialised memory mappingRSDuck2020-06-16
| | |