Commit Graph

78 Commits

Author SHA1 Message Date
RSDuck 22b312bc43 implement 8- and 16-bit DSi AES register accesses
fixes NAND access through Godmode9i
2022-08-21 21:31:11 +02:00
RSDuck f0657e1a9b basic implementation of SNDExCnt
isn't hooked up to the DSP or microphone though
fixes memory abort in TwilightMenu
2022-08-21 16:40:30 +02:00
Arisotura 0294bcb5f2 add support for the mainRAM mirror at 0x0C000000 in DSi mode, makes SM64DSi work correctly 2022-04-10 14:54:40 +02:00
Arisotura 35cc79787d update copyright headers 2022-01-09 02:15:50 +01:00
Arisotura e665e25bd3
Custom path support (#1333)
also including:
* getting rid of shitty strings
* all new, cleaner ROM handling code
* base for DSi savestates
* GBA slot addons (for now, memory cart)
2022-01-07 14:00:43 +01:00
Arisotura 97e599f90f what. 2021-11-22 18:59:49 +01:00
Arisotura e24a4e5e97 ensure shit doesn't asplode atleast until this code is redone 2021-11-21 16:12:07 +01:00
Arisotura 333b1247d9 remove remains of SDIOFile 2021-11-21 16:05:48 +01:00
Arisotura 7a0286a43d make firmware settings override also apply in DSi mode 2021-11-20 12:09:13 +01:00
Arisotura 5bb8f4c922 * remove more Config dependencies from the core
* also use less shitty strings
2021-11-17 20:42:11 +01:00
Arisotura 43daa1c7d2 blarg 2021-10-28 21:24:39 +02:00
Arisotura e121953c9a more complete (and accurate) CP15 setup for direct boot 2021-10-28 21:15:12 +02:00
Arisotura d20543c119
DMA timing renovation (#1207)
* make timers usable for measurement shito without being assfuckingly unreliable

* bürp

* Arisotura can you ever clean up your goddamn code

also regroup the timer code instead of having it split weirdly

* make the set-timing functions a tad less hacky

* congrats Arisotura you made an ass-enum

* add timing region tables, and separate timings for ARM9 DMA (exempt of 3c penalty)

* temp work on DMA timings, not finished

also, did you know? 'increment/reload' is also a thing for the source address

* begin work

* add some of the GBA slot/wifi timings

* complete it, I guess

* make some progress

* getting somewhere

* sdsdfs

* see, Arisotura, was it that hard? blarg.
2021-08-31 02:28:34 +02:00
Arisotura e1f3fc75ea * add TSC shito
* fix possible modcrypt shittiness
2021-08-30 21:42:35 +02:00
Arisotura 523552a92d actually make DSi-mode direct boot work to some extent 2021-08-30 20:26:49 +02:00
Arisotura 235da420c8
having fun with fatfs (#1189)
* patch TSC coords in DSi mode
* DSiware importer and shit
2021-08-24 17:46:20 +02:00
DesperateProgrammer 85c2a76774
Fix for https://github.com/Arisotura/melonDS/issues/1169 (#1171)
* Fix for https://github.com/Arisotura/melonDS/issues/1169
LoadNAND was storing the stage 2 bootloader, while NWRAM access was disabled by Bit25 of SCFG_EXT putting the stage 2 into old shared WRAM, while executing it later with the bit enabled and fetching from an empty NWRAM.

* Fixed bug, where access to the NWRAM Bank A used the wrong page mask for write access

* Remove spaces before comma

Co-authored-by: Tim Seidel <t.seidel@kts-systeme.de>
Co-authored-by: RSDuck <RSDuck@users.noreply.github.com>
2021-08-02 22:15:33 +02:00
DesperateProgrammer b1c2665c39
NWRAM & Direct Boot (#1149)
* 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>
2021-07-23 12:21:54 +02:00
DesperateProgrammer 3a9e07c0b1
Fallback to backup DSi Footer in NAND Image (#1154)
* - added fallback to DSi footer copy at 000FF800h if reading footer at end of file failed. See https://problemkaputt.de/gbatek.htm#dsisdmmcimages
- changed output of ConsoleID to use PRIx64 to be consistent with all other tools working with the consoleID (readability/cosmetic improvement)

* Remove extra space

Co-authored-by: Tim Seidel <t.seidel@kts-systeme.de>
Co-authored-by: RSDuck <RSDuck@users.noreply.github.com>
2021-07-13 15:01:42 +02:00
purringChaos e3b4350f44
Add PoroCYon's DSP code. (#1123)
* 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
2021-06-06 18:27:26 +02:00
RSDuck 21f5477450 PRIu64 requires inttypes.h to be included 2021-06-05 03:34:39 +02:00
WaluigiWare64 e02bbcb3ac Use printf macro for u64 2021-05-16 17:17:57 +01:00
Arisotura 55a129e1a2 make sure to axe the GBA slot in DSi mode. (EXMEMCNT bit7 still applies to it, tho) 2021-04-25 13:13:16 +02:00
RSDuck 436b3c4c1d update copyright year and add missing GPL headers 2021-03-12 20:07:40 +01:00
WaluigiWare64 43348210f9 Fix some compiler warnings 2021-01-25 14:12:13 +00:00
RSDuck 1d6cc3c6ef keep only one handle of the NAND file around 2021-01-17 19:56:02 +01:00
Arisotura 129018a662 Merge remote-tracking branch 'remotes/origin/master' into dsi_camera 2020-12-04 18:28:15 +01:00
RSDuck d697f9e0d2 make fastmem work again 2020-11-13 15:20:53 +01:00
Arisotura fc922ffb14 Merge branch 'master' into dsi_camera
# Conflicts:
#	src/DSi_I2C.cpp
2020-10-26 20:47:30 +01:00
Arisotura 8d42b1c7d7 messin' around 2020-09-08 20:19:37 +02:00
PoroCYon 00e2ec3faf
fix 8-bit ConsoleID address decoding typo (#749) 2020-09-07 04:09:03 +02:00
Arisotura aa94cbaeb0 DSi: add support for 8-bit VRAM writes when enabled in SCFG_EXT. fixes #733 2020-09-03 11:51:50 +02:00
Arisotura ba373ca72a DSi: make ARM9-clock-selector actually work 2020-08-17 19:15:45 +02:00
RSDuck 2a3147db46 reset fastmem on DSi soft reset 2020-07-31 22:39:27 +02:00
Nadia Holmquist Pedersen b4ad35948d Merge remote-tracking branch 'upstream/slirp' into slirp-merge 2020-07-26 21:41:09 +02:00
RSDuck 8a96dfce18 fix build with JIT disabled
fixes #675 and #674
2020-07-25 20:59:53 +02:00
RSDuck c5381d2911 reconcile DSi and JIT, fastmem for x64 and Windows 2020-06-30 23:50:41 +02:00
Arisotura 5cd1177e34 huh. all DSi files had outdated copyright years 2020-06-05 20:44:18 +02:00
Arisotura ffa29ff496 clean it up some 2020-06-02 00:36:07 +02:00
Arisotura d0af89924e remove requirement for initmem7/9.bin (but this requires augmented BIOS dumps, we'll get there) 2020-06-02 00:25:29 +02:00
Arisotura ee9fe327e2 remove requirement for aeskeys.bin and boot2_7/9.bin 2020-06-01 23:13:38 +02:00
Arisotura 43e045357f make it able to switch between DS and DSi modes 2020-06-01 20:36:30 +02:00
Arisotura 6326ddd172 reset SD controllers during a soft-reset 2020-06-01 16:32:44 +02:00
Arisotura 8f5dff1725 make soft-reset work somewhat better 2020-05-30 13:52:51 +02:00
Arisotura f9ac26078b look for NAND nocash footer at the end of the file rather than using a hardcoded offset. check whether the footer is present. 2019-10-20 18:52:33 +02:00
Arisotura 1c72df43ab messing around 2019-10-20 18:35:16 +02:00
Arisotura e82364f010 * some fixes to SD controller support, make it clear that there is no SD 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!
2019-10-19 16:03:59 +02:00
Arisotura 4d3d8433cb * add old DS BIOSes and 04004000 BIOS-switch
fixes audio issues when running DS games
* attempt adding other fun shit like dynamic RAM size, but that mostly went nowhere for now
2019-08-05 19:52:03 +02:00
Arisotura 36c741241a support DSi-mode carts
except they need to have the DSi-mode shit encrypted
2019-08-04 16:46:02 +02:00
Arisotura f7f4ff0519 wifi: take this shit further. complete wifi init 2019-08-04 02:16:16 +02:00