Commit Graph

1892 Commits

Author SHA1 Message Date
RSDuck 43d091361e fix #1551 2022-11-25 23:47:36 +01:00
RSDuck 3111431a3f fix #1556 2022-11-14 18:29:44 +01:00
pepper-jelly 5488e0bf3d
prevent screensaver (#1485) 2022-11-11 23:18:28 +01:00
mariomadproductions 88c1371a96
Added LEGO Batman 2 - DC Super Heroes (Canada) (En,Fr) [B6FL] to ROMList (#1422) 2022-11-11 23:08:55 +01:00
Quinn Painter 2256b64fcd
Fix nocash Char Out debug register (#1500)
To match no$gba, this register should output any ASCII character written to it, not print the number as it currently does.
2022-11-11 23:03:17 +01:00
Nadia Holmquist Pedersen 726fde4e8d Explicitly include the build/res directory so windres will find it when
using the CMake Makefile generator
2022-11-09 19:44:07 +01:00
Pk11 31a0d7ecd2
Allow import/export of .pub/.prv/.bnr saves (#1558) 2022-11-07 16:03:00 +01:00
Nadia Holmquist Pedersen ca19ea1ce8 Windows resource/manifest fixes
* 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
2022-11-06 02:53:51 +01:00
Nadia Holmquist Pedersen 659b7214c7 Use WGL for GL context creation on Windows ARM64 as well.
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.
2022-11-05 22:38:23 +01:00
Nadia Holmquist Pedersen 9a5e884913 JIT: Add bits for Windows ARM64 support 2022-11-05 22:37:27 +01:00
Nadia Holmquist Pedersen c387fb1819 mainWindow may be nullptr when audioMute() is called.
Fixes potential crash on launch when multiplayer audio output is set to only the current window.
2022-11-05 16:57:28 +01:00
Arisotura 019120ebb8 fix a tidbit with GXFIFO NDMA, I think 2022-11-03 20:22:46 +01:00
Arisotura 4ef2e1f4cc fix up DSi direct boot 2022-10-28 21:31:51 +02:00
patata 561781b954
CLI 2.0: Electric Boogaloo (#1546)
* 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
2022-10-28 12:27:55 +02:00
Arisotura 936011964c comment out semaphore shit in teakra 2022-10-25 00:09:43 +02:00
Nadia Holmquist Pedersen 9e449d902d Make clang shut up about -Wno-error=maybe-uninitialized in teakra 2022-10-23 16:52:18 +02:00
orbea b5017caa33 fatfs: Fix -Wstrict-prototypes + -Wimplicit-function-declaration warnings
This will be required for upcoming gcc and clang versions.

Reference: https://archives.gentoo.org/gentoo-dev/message/dd9f2d3082b8b6f8dfbccb0639e6e240
2022-10-23 16:33:29 +02:00
Arisotura dd74e936ed force-align all read/write accesses. fixes #1540 (unaligned DMA address) 2022-10-22 13:11:57 +02:00
Nadia Holmquist Pedersen b6776bd826 getWindowInfo: handle if the Wayland window handle is null 2022-10-19 00:03:28 +02:00
RSDuck ac3118cbc5
No more context mess (#1531)
* 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>
2022-10-17 22:55:11 +02:00
Arisotura 31ba585d39 more fun DSP fixes
* aac.a thinks it is funny to start DMA by writing to 8184 directly
* implement retd (gross hack!!)
* remove another unimplemented exception (wat)
2022-10-17 20:16:19 +02:00
Arisotura 243a02767a I don't think NWRAMMask is relevant here 2022-10-14 00:22:39 +02:00
Arisotura cdd05c10b4 more DSP unfucking: make Teakra directly use melonDS's NWRAM banks instead of trying to translate to a flat buffer, fixes bugs with the way the memory banks are ordered etc 2022-10-14 00:02:54 +02:00
Nadia Holmquist Pedersen 349316a078 Work around a really strange issue when building teakra with -O0 on Windows 2022-10-12 20:49:15 +02:00
Arisotura b33f0434a6 unfuck the DSP enough that it will actually run code
(don't get your hopes up, it's still pretty much a trainwreck)
2022-10-11 00:26:42 +02:00
Arisotura b76e5adc1d unfuck the DSP code some
(still doesn't work)
2022-10-10 00:22:46 +02:00
Nadia Holmquist Pedersen aa9a6ceed5
Merge pull request #1282 from gal20/scale_fix
Fix screen scaling error
2022-10-04 20:40:00 +02:00
Arisotura 1a602376c7 this was prolly bad 2022-10-04 19:37:49 +02:00
Arisotura 571d1c403f properly stop any started cameras upon reset/shutdown 2022-10-02 23:29:24 +02:00
Arisotura 62879c4484 add support for UYVY format (FaceTime camera) 2022-10-02 19:43:57 +02:00
Arisotura af9a77b0b4 camera: fix x-flip crustiness 2022-10-02 18:44:47 +02:00
Arisotura 3f4573574a
actual DSi camera support (#1520)
basically feeding something that isn't a fixed stripe pattern, and emulating enough of the camera hardware to make this work
2022-10-02 16:47:57 +02:00
Nadia Holmquist Pedersen 37e5e2c3c0 Account for the screen gap being scaled with the window size
Fixes #1430
2022-09-25 20:48:40 +02:00
Arisotura 86786738cc properly make the DSi NAND instance-unique 2022-09-23 22:53:23 +02:00
Arisotura fc11258071 remove Windows console shito we don't need anymore 2022-09-22 20:33:32 +02:00
Arisotura b1e4bd5520
merge local_wifi (#1516)
* 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>
2022-09-22 20:32:27 +02:00
Nadia Holmquist Pedersen b5073e6014 lol oops 2022-09-18 23:39:19 +02:00
Rayyan Ansari 61de50069b Fix handling of utf16 title strings in ROMInfoDialog
Title strings should be null-terminated.
Read the string up until this point instead of reading the full 128 characters.
(Also fix the .ui file of ROMInfoDialog to prevent it from being too wide.)
2022-09-02 11:57:49 +01:00
Rayyan Ansari c3bd1d2e83
Fix reading banner from homebrew ROMs
Some homebrew ROMs do not have a banner, and use a null value to indicate this.
Do not attempt to read the banner when this is the case.
2022-09-02 11:47:12 +01:00
RSDuck ce68e883c4 for all people who hate speed, here you can build melonDS again 2022-08-22 00:44:48 +02:00
RSDuck 32609bbc98 invalidate JIT blocks in ARM7 WVRAM when it's remapped 2022-08-22 00:39:08 +02:00
RSDuck d56219c33c fix SCFG_MC cartridge inserted bit 2022-08-21 22:11:22 +02:00
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 4c97731468 fix last commit for when no SD is inserted 2022-08-21 19:55:23 +02:00
RSDuck 334fc1717d fix DSi SD newly inserted/removed IRQ bits
we don't support SD card hot swapping and SDIO wifi is always inserted, so those bits are always zero
special thanks to Evie
2022-08-21 19:52:23 +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
Nadia Holmquist Pedersen 3ad5f3e22e Fix Windows debug builds not having a console because something, probably some library's CMake script, sets -mwindows when it shouldn't. 2022-08-17 20:04:43 +02:00
RSDuck 5baf5fe77b a bit of refactoring around ScreenHandler
also gets rid of that annoying warning about const char* being converted to char*
2022-08-05 20:22:10 +02:00
Nadia Holmquist Pedersen 2ba7f961a6 Apply strong focus policy to joystick mapping button as well. Fixes #1491 2022-07-31 21:18:08 +02:00
Valtýr Kári Daníelsson 98903f8076 fixes editor warnings about undefined types in a bunch of files 2022-07-27 18:55:59 +02:00
Valtýr Kári Daníelsson 457dd56b88
constexpr-s the DMA timing tables (#1489) 2022-07-27 17:01:31 +02:00
Nadia Holmquist Pedersen f5c1094d03 Fix triggers being recognized as negative analog stick values when assigning an input if the axis is moved too slowly. 2022-07-07 23:18:56 +02:00
Nadia Holmquist Pedersen 35cbda9001 GL: Fix 16x resolution on macOS 2022-06-02 00:55:29 +02:00
Nadia Holmquist Pedersen f85925fcd6 Add 3DS 16:10 aspect ratio and refactor GUI aspect ratio code 2022-05-23 16:59:50 +02:00
Nadia Holmquist Pedersen 94b33c924e
Modernize CMake build system (#1434)
These changes modernize the CMake build system to (hopefully) match newer best practices

* Library linking is simpler and more automatic because of using imported targets
* Multi-configuration builds should be supported (Ninja Multi-Config, Visual Studio, etc. generators)
* Clean up build options using cmake_dependent_option
* Let CMake do its job in more cases, like finding the math/dl libraries and detecting and enabling LTO support
* Remove platform-specific kludges like the Fedora/flatpak LTO workaround and a bunch of Windows stuff
* Simplify Windows static builds
* Consistent formatting
2022-05-21 19:54:55 +02:00
Nadia Holmquist Pedersen 4cc34121b0 Update teakra (fixes #1441) 2022-05-13 20:31:24 +02:00
Nadia Holmquist Pedersen ed2121d7ec Accomodate top/bottom only lzyout when setting screen size 2022-04-20 15:50:01 +02:00
Arisotura 529a690089 fix potential issues with 32bit GPU writes 2022-04-10 15:11: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 b572d8cd70 add support for GXFIFO NDMA 2022-04-10 02:15:49 +02:00
Arisotura 0feed13cc4 close gaps in VRAM mapping 2022-04-09 19:40:35 +02:00
Arisotura 86f725f2f2 master brightness has different biases (are you serious, Nintendo)
also add all these biases to the OpenGL compositor
2022-04-08 01:08:19 +02:00
Arisotura f6a55354fa remove some cruft 2022-04-08 00:34:07 +02:00
Arisotura 879695070a make blending/fade accurate too (not quite sure about the 3D one) 2022-04-01 13:57:28 +02:00
Arisotura 1dfcf2010a Merge branch 'master' of github.com:Arisotura/melonDS 2022-04-01 12:54:58 +02:00
Arisotura d296f2832c make display-capture blending accurate to hardware 2022-04-01 12:54:47 +02:00
Nadia Holmquist Pedersen 02b859ad9d Disable firmware overrides UI when override checkbox isn't checked 2022-03-28 00:55:18 +02:00
Arisotura 5ca8728cbf save WFC settings when using default firmware. fixes #1401, also fixes #1336 2022-03-22 23:21:45 +01:00
Arisotura 599deeb2b8 default firmware: in DSi mode, emulate more compatible DWM-W015 instead of DWM-W024 2022-03-20 18:13:32 +01:00
Arisotura 709a5980ed FreeBIOS: add VRAM-compliant LZ77 decompressor. fixes #1353 2022-03-14 19:42:30 +01:00
Arisotura 3756f3cb1f make invalid SPI memory commands return 0xFF. fixes #1366 (Dementium II checks the results of RDSR, RDID and cmd 00 to determine what kind of backup memory is present) 2022-03-14 18:08:29 +01:00
Arisotura 5415f8a746 what. 2022-03-14 11:51:10 +01:00
Arisotura d8f87df2b7 DISPCAPCNT is writable at any time 2022-03-14 01:09:07 +01:00
Arisotura fb7bea06f8 fix some gaps in the SPI/cart implementations 2022-03-14 00:27:03 +01:00
Arisotura f7fa0dda50 * support patching multiple DLDI interfaces
* fix the DLDI size entry
fixes the Smash demo
2022-03-12 21:52:29 +01:00
Arisotura cce9de5ee1 BLARG 2022-03-08 14:42:02 +01:00
Arisotura fe96944fc0 insert wacky commit message 2022-03-08 12:03:16 +01:00
Arisotura 2eec033c72 save battery levels to config 2022-03-07 21:08:54 +01:00
Arisotura 532b1c967a fix up the power management dialog 2022-03-07 21:08:54 +01:00
Arisotura 9394dde67a fix copyright headers 2022-03-07 21:08:54 +01:00
Rayyan Ansari 2569c67a13 Add support for changing the DS and DSi battery level
The DS battery level is configured via the SPI Power Management Device,
and the DSi's is configured via the I2C BPTWL. Add support for changing
these registers and add the "Power Management" dialog in the UI.
2022-03-07 21:08:54 +01:00
Pk11 c3adf6f606
Improve DSiWare save creation (#1375) 2022-03-07 21:08:29 +01:00
2jun0 c66df57256
Implement MainRAM management dialog😁 (#1248)
* Implement MainRAM management dialog

* Modify RAMInfoDialog

- use emuThread to avoid a race condition.
- replace RAMUpdateThread to QTimer

Co-Authored-By: RSDuck <RSDuck@users.noreply.github.com>

* Update src/frontend/qt_sdl/RAMInfoDialog.cpp

small typo

Co-authored-by: Rayyan Ansari <68647953+RayyanAnsari@users.noreply.github.com>

* Update src/frontend/qt_sdl/RAMInfoDialog.h

small typo

Co-authored-by: Rayyan Ansari <68647953+RayyanAnsari@users.noreply.github.com>

* typo errors in RAMInfoDialog

Rrevious->Previous

* add new line to the end of the file

Co-authored-by: Rayyan Ansari <rayyan@ansari.sh>

* enable raminfo when cart is inserted

* Modify that only the 'value' item can be edited in RAMinfoDialog

* fix: function name incorrect error

* fix: function name incorrect error2

* fix: wrong way to get ram value

Co-authored-by: RSDuck <RSDuck@users.noreply.github.com>
Co-authored-by: Rayyan Ansari <68647953+RayyanAnsari@users.noreply.github.com>
Co-authored-by: Rayyan Ansari <rayyan@ansari.sh>
2022-03-06 22:33:11 +01:00
Nadia Holmquist Pedersen 088d49b9cb macOS: Use Qt 6 by default 2022-03-06 20:12:20 +01:00
Nadia Holmquist Pedersen b1565ec87a macOS: Bump minimum version to 10.15 2022-03-06 20:06:11 +01:00
Arisotura 2af8e65f23 we prolly don't need to init SDL video, given we don't use it 2022-03-06 10:49:05 +01:00
Arisotura ef7dfb8872 fix the GBA cart save shito, I guess 2022-03-04 20:54:45 +01:00
Rayyan Ansari f4f6f6dfc5
InputConfig: change Group Box titles to Labels
On GNOME, the Group Box's titles don't align with the text in the buttons.
This commit removes the Group Box titles and instead uses Labels to fix this.
2022-03-04 17:52:49 +00:00
Brankale 2c21787f33
fix typo in enum for screen sizing (#1377) 2022-02-25 20:28:21 +01:00
RSDuck 550db94a87 Use enum for screen sizing 2022-02-25 16:35:21 +01:00
ZackWeinstein e3ad78e84f
Allowing Swap screens hotkey to swap between displaying only top screen and only bottom screen. (#1283) 2022-02-25 15:58:31 +01:00
RSDuck bb67e186df comment out debug printfs 2022-02-25 14:35:45 +01:00
RSDuck 0a1fb5ae50 Wifi power saving, hopefully enough! 2022-02-25 14:25:19 +01:00
RSDuck 03b5c48088 lower window update rate if rendering too fast 2022-02-14 00:27:00 +01:00
Arisotura 0761fe736f add support for zero-address in AR codes 3-A 2022-01-28 20:56:08 +01:00
Arisotura 915edd777e hopefully fix #1349 2022-01-24 12:16:39 +01:00
Nadia Holmquist Pedersen 2bda2f127b nifi: Set SO_REUSEPORT on BSD and macOS to prevent creation of socket failing 2022-01-12 20:40:39 +01:00
Arisotura dff8980a27 Merge branch 'master' of github.com:Arisotura/melonDS 2022-01-09 02:16:03 +01:00
Arisotura 35cc79787d update copyright headers 2022-01-09 02:15:50 +01:00
Nadia Holmquist Pedersen 0a8f3c9344 Make the message when SDL2 fails to init more descriptive 2022-01-08 19:35:21 +01:00
Arisotura 10d7831917 can we, please, FINALLY, be done with this stupid issue 2022-01-08 12:53:06 +01:00
Arisotura 5c719a774f fdsfdfdgdfgfgdfg 2022-01-08 12:18:24 +01:00
Arisotura 80564ba947 explicitly eject the cart before a load with reset, preventing a spurious cart-eject IRQ on startup
also fix possible KEY1 issues when using internal BIOS
2022-01-08 11:20:21 +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
gal20 dfb2111a00 Fix screen scaling
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
2022-01-05 21:03:13 +02:00
Charlene Campbell c4cd9da674 don't link rt when oglrenderer disabled on apple 2021-12-29 18:28:27 +01:00
Nadia Holmquist Pedersen f39eeeb9dd
title import: create all title/ subdirectories 2021-12-18 02:56:27 +01:00
Nadia Holmquist Pedersen 203cf5164b Create ticket subdirectory if missing during title import 2021-12-16 06:33:32 +01:00
Nadia Holmquist Pedersen f1c9b42b45 ScreenPanelNative: Don't try to render the framebuffer if the emulator is not actually active.
This fixes an issue where the window draws with a gray background in macOS, and is see-through on Wayland-based desktops.
2021-12-09 01:57:02 +01:00
Nadia Holmquist Pedersen 14c6bba21f Manually center the window after setting its size on macOS
Qt's default window positioning is somewhat unreliable, and since we
don't currently remember the window position, let's at least make sure
that it's properly centered on open.
2021-12-09 01:21:06 +01:00
andrigamerita 151610eb6c
Treat SDL_INIT_JOYSTICK fail as non-critical (#1277)
Treating the fail of SDL_INIT_JOYSTICK as non-critical, because on some systems that SDL feature can for some reason fail. This leads to the emulator closing with a critical error, even though it would work perfectly fine with just a keyboard.
2021-12-01 13:52:58 +01:00
Arisotura 3300cc8f15 really, Arisotura? 2021-11-28 13:36:00 +01:00
Arisotura 44757a8323 SPU: block reads from ARM7 BIOS region. fixes #1267 (and prolly whatever other stupid game tries to play sound from NULL) 2021-11-25 16:49:43 +01:00
Arisotura c04e43702c SPU: correctly read negative ADPCM initial values. fixes #1261 2021-11-23 18:47:54 +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 73d7bada87 add valid wifi data to the default firmware 2021-11-20 13:22:20 +01:00
Arisotura 8100b6da6b ASGYHFDUHDIUIHSJODHSIJDHSIYGDHSJKDSDSDSDSD 2021-11-20 12:16:59 +01:00
Arisotura 7a0286a43d make firmware settings override also apply in DSi mode 2021-11-20 12:09:13 +01:00
Arisotura 593eb7c81c hopefully fix Qt6 2021-11-19 17:03:45 +01:00
Arisotura 1472a0ec4b move 'randomize MAC' setting to firmware settings, and add setting for changing the MAC.
make things overall betterer.
2021-11-19 13:31:14 +01:00
Arisotura 1fc775d964 better suited entry method for the firmware birthday 2021-11-18 20:24:37 +01:00
Arisotura 08eda46706 fix potential crash with firmware dialog (when closing dialog via X and opening it again) 2021-11-18 18:25:19 +01:00
Arisotura f73df85d1c make external-BIOS toggle also explicitly control external firmware
make things a tad more consistent and explicit
2021-11-18 18:17:48 +01:00
Arisotura 19ddaee13b finally decouple Config from the core. baahhahahahah 2021-11-18 01:17:51 +01:00
Arisotura 65c2a844ac oops 2021-11-17 23:23:22 +01:00
Arisotura e8bae0e146 what 2021-11-17 23:09:42 +01:00
RSDuck 3be26f456b prevent out of bounds write 2021-11-17 22:59:28 +01:00
Arisotura d5b248bb86 decouple more config shit from the core. bahahah 2021-11-17 21:44:49 +01:00
Arisotura 13afaa0303 remove some more shitty strings 2021-11-17 20:57:30 +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 69715043ca blfdlkgdfgdf 2021-11-17 18:41:59 +01:00
Arisotura c1dcd585be decouple JIT from Config. bahahahahah 2021-11-17 18:15:50 +01:00
Arisotura 53dfcfb18a nicerer firmware color picker
also consistency aaaaaaaaaa
2021-11-17 14:53:46 +01:00
Arisotura c6d1977448 UI consistency!!!! 2021-11-10 23:59:54 +01:00
Arisotura 3fad5dcbbb make the firmware dialog consistent with the rest of the UI 2021-11-08 20:57:26 +01:00
RSDuck c233d99211 dtcm not dtcb 2021-10-29 12:09:00 +02:00
RSDuck 6c2ea93173 get rid of DTCMSize 2021-10-29 01:35:47 +02:00
Arisotura 635a47014f fix more bugs in the DLDI machine 2021-10-29 01:33:37 +02:00
Arisotura cca5615748 add the PU checks. bahahahah 2021-10-29 00:36:55 +02:00
Arisotura ead8d1b629 more UTF8 shenanigans huh 2021-10-28 23:51:25 +02:00
Arisotura 8b59c73c01 also don't try to save if there's no folder to sync to 2021-10-28 23:48:20 +02:00
Arisotura d25102a9c8 don't explode if the folder-sync path points to a non-existing folder 2021-10-28 23:45:14 +02:00
Arisotura c532059cd3 oops! 2021-10-28 22:45:23 +02:00
Arisotura 15a66b1be1 more accurate DTCM check 2021-10-28 22:41:42 +02: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 bfe50e41b4 MCR/MRC aren't available in user mode 2021-10-28 19:47:26 +02:00
Arisotura 9d82826cdb fix some gaps in CPU modes
* non-defined CPU modes are actually possible
* bit4 of all PSRs is forced to one (modes 00-0F aren't possible)
* modes 14/15/16 and 18/19/1A share a SPSR with modes 17 and 1B respectively (but they don't share the register banks)
* modes 10 and 1C/1D/1E don't have a SPSR (MRS returns the CPSR always)
2021-10-28 19:45:32 +02:00
Arisotura ae489d9e03 zarg 2021-10-28 18:55:22 +02:00
Arisotura ff3f661bb5
DLDI/SD folder-sync apparatus (#1251)
guess we can finally have DLDI that isn't obtuse
2021-10-28 18:47:13 +02:00
scurest a8613af2bd
InputConfigDialog: more DRY (#1238) 2021-10-10 22:51:08 +02:00
Nadia Holmquist Pedersen a9fc0adf96
Move resources to res/ directory (#1204)
* Move resources to res/ directory and update CMake scripts accordingly

Co-authored-by: Rayyan Ansari <68647953+RayyanAnsari@users.noreply.github.com>
2021-10-03 09:37:33 +00:00
Adrian Siekierka d378b0252f
Generate a simple non-bootable firmware when not provided. (v2) (#1175)
* Generate a simple non-bootable firmware when not provided.

* Expose Username and Language into settings dialog.

* Add firmware overrides for more settings. Also make override optionals when a firmware is provided.

* Refactor firmware settings into separate dialog.

* use usernameLength instead of u16Username.length() (#3)

* Fix curly braces code-style.

* LoadUserSettingsFromConfig: convert from UTF-8 to UTF-16 via wstring_convert

* Fix firmware username capitalization.

* cleanup firmware backup logic

* Put brace where it should be

Co-authored-by: Rayyan Ansari <68647953+RayyanAnsari@users.noreply.github.com>

Co-authored-by: Filippo Scognamiglio <flscogna@gmail.com>
Co-authored-by: kyandora <71771686+kyandora@users.noreply.github.com>
Co-authored-by: Filippo Scognamiglio <filippo.scognamiglio@felgo.com>
Co-authored-by: RSDuck <RSDuck@users.noreply.github.com>
Co-authored-by: Rayyan Ansari <68647953+RayyanAnsari@users.noreply.github.com>
2021-10-02 20:16:27 +02:00
Nadia Holmquist Pedersen b92622b765 Revert "Misc fixes for dsiwifi BMI stage (#1216)"
This reverts commit a54b076b06.
2021-10-02 13:57:52 +02:00
Adrian Siekierka b7992cc084
Fallback to FreeBIOS when BIOS files are not found. (v2) (#1174)
* Fallback to FreeBIOS when BIOS files are not found.

* Add sources of drastic bios files.

* Move FreeBIOS/external BIOS choice to configuration option/checkbox.

* Fix indentation

Co-authored-by: Filippo Scognamiglio <flscogna@gmail.com>
Co-authored-by: Filippo Scognamiglio <filippo.scognamiglio@felgo.com>
2021-10-02 12:06:22 +02:00
Rayyan Ansari 796d603332
Redesign the Input dialog (#1226) 2021-09-30 17:23:25 +00:00
RSDuck 737171c906 implement margins for scheduler
hopefully this does not break anything
2021-09-27 03:30:15 +02:00
Nadia Holmquist Pedersen 1471c73ea6 buttonClicked workaround for old Qt 2021-09-17 18:36:07 +02:00
Arisotura 66a58f7478 misc. DSP fixoring
(still doesn't work)
2021-09-11 23:59:23 +02:00
Max Thomas a54b076b06
Misc fixes for dsiwifi BMI stage (#1216) 2021-09-06 12:52:33 +02:00
Arisotura 9514efe4a0 BAHAHAHAHAHAHAAAAA-+*~+ 2021-09-02 00:16:36 +02:00
RSDuck 55ec724fee more fixes for literal invalidation 2021-08-31 08:13:22 +02:00
RSDuck 8d2746e517 fix #1187
how could this go on unnoticed for so long?
2021-08-31 04:53:25 +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 e7f0923623 maybe don't leave in debug code, you derp 2021-08-30 20:28:51 +02:00
Arisotura 523552a92d actually make DSi-mode direct boot work to some extent 2021-08-30 20:26:49 +02:00
Arisotura b84155e891 I'm a derp 2021-08-27 16:45:26 +02:00
WaluigiWare64 34af921322 ROM Info dialog - Only read 128 characters from each title
Titles should be zero-terminated, but this is for additional safety
2021-08-27 13:54:55 +01:00
Arisotura 36672a4089 use NDSHeader struct, and expand it with the DSi shit 2021-08-26 18:59:07 +02:00
Nadia Holmquist Pedersen 7395d6a6c0 Allow picking .dmg files as SD image 2021-08-26 18:55:49 +02:00
Arisotura b40ff12a60 fix capitalization of DSiWare. heh 2021-08-25 12:31:20 +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
2jun0 346e8c0b87
Fix a touchless issue in hybrid layout (#1182)
In the previous commit, there was a touchless error on the hybrid screen.
This commit fix a touchless issue in hybrid layout.
2021-08-24 17:40:35 +02:00
Nadia Holmquist Pedersen 0d37a0a5fc Call emuPause before loading a ROM so we don't crash if one is already loaded 2021-08-23 10:45:18 +02:00
Nadia Holmquist Pedersen 6ad0e8d61a macOS: Allow opening ROMs with melonDS from Finder. 2021-08-23 10:27:03 +02:00
RSDuck 883fceb6ce use std::swap 🔃 2021-08-21 01:54:45 +02:00
Nadia Holmquist Pedersen 415ab22f3a fark 2021-08-17 01:01:15 +02:00
Nadia Holmquist Pedersen 2aeb452dfb SPU: Do clamping after applying SOUNDBIAS 2021-08-17 01:01:15 +02:00
Nadia Holmquist Pedersen 418b351986 SPU: Emulate SOUNDBIAS and 10-bit degrade 2021-08-17 01:01:15 +02:00
Arisotura d5a20ad3c8 tidbits 2021-08-08 15:45:44 +02:00
Arisotura c7325469c2 factor duplicate code in micLoadWav(). also add support for all sorts of WAV formats SDL can support. 2021-08-08 15:32:29 +02:00
Arisotura bba14b2bb0 fix pissfucking touchscreen (again) 2021-08-08 14:45:16 +02:00
Arisotura 2df6b4fdc3
Audio interpolation (#1176)
add audio interpolation (emulation improvement)
2021-08-08 14:27:57 +02:00
RSDuck b28a9e4d24 JIT: don't lengthen blocks on a skipped SVC
SVC would need special handling because of the bank switching
2021-08-04 14:58:41 +02:00
RSDuck f900792dc0 addition to last commit 2021-08-04 14:35:54 +02:00
RSDuck f792d3e6a1 handle changed VCount+threaded rasteriser more gracefully 2021-08-04 14:21:45 +02:00
Nadia Holmquist Pedersen 996bfe8436 Make limit framerate default instead of audio sync 2021-08-04 00:53:47 +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
RSDuck 946eb7a834 fix pause when inactive 2021-08-02 20:41:43 +02:00
gal20 1bda85383f Fix for #1119 'Add "frame step" hotkey' 2021-07-30 18:16:26 +02:00
Arisotura aaa97c9242 only open microphone when actually needed. fixes #1165 2021-07-29 01:19:03 +02:00
RSDuck 9ee2017443 don't add constant cycles if they're 0 2021-07-24 17:07:08 +02:00
RSDuck 6944fdbe78 add support for JIT profiling with VTune 2021-07-24 16:20:03 +02:00
RSDuck c9b918d305 fix last commit for aarch64 2021-07-24 04:45:33 +02:00
RSDuck c2152c8f74 JIT: fix ldm with writeback loading rn 2021-07-24 04:35:45 +02:00
WaluigiWare64 8513900892 ARM64 macOS JIT - fix warnings + some cleanup 2021-07-23 14:07:23 +01: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
Arisotura cd4ef575ee NDSCart: correctly restrict reading the DSi region on DSi carts 2021-07-22 21:37:34 +02:00
Arisotura ab48461dc5 Merge branch 'master' of https://github.com/Arisotura/melonDS 2021-07-20 19:30:47 +02:00
Arisotura 740071e427 oopsies 2021-07-20 19:30:29 +02:00
RSDuck fdb6d226fd enable undo savestate load in the gui 2021-07-17 23:30:57 +02:00
Arisotura 98072d82bf shut up DSi-IO warnings 2021-07-17 18:26:56 +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
WaluigiWare64 e5240a688c
Add ROM Header struct and ROM info dialog (#1095) 2021-07-02 16:42:54 +00:00
RSDuck 5a071c4c29 some tiny A64 optimisations 2021-06-30 00:41:04 +02:00
RSDuck aa430608e7 support allocating more registers for aarch64 JIT
also some minor fixes for the x64 JIT as well
2021-06-29 22:25:43 +02:00
RSDuck dd53b01f76 only recalculate GBA slot timing if necessary 2021-06-27 00:45:21 +02:00
Arisotura dd2b86d026 add missing default return value. fixes #1105 2021-06-20 02:23:45 +02:00
Arisotura 5b9f972625 UI: detect and save when window is maximized, and restore it as such. fixes #1135 2021-06-20 02:21:48 +02:00
WaluigiWare64 f94b784c4d Use printf format macro here 2021-06-07 20:51:51 +01:00
RSDuck 1793abcfb4 don't printf from exception handler
it was handy for debugging, but it's dangerous
2021-06-07 19:02:09 +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
cat 2494058a71
Add "frame step" hotkey and function (#1119) 2021-06-05 21:10:37 +02:00
Nadia Holmquist Pedersen af36d10023 Explicitly set NoRole on the setup cheats option so Qt on mac will stop stealing it 2021-06-05 14:47:51 +02:00
RSDuck 21f5477450 PRIu64 requires inttypes.h to be included 2021-06-05 03:34:39 +02:00
Pedro f74387a8c1
Implement NO$GBA debug registers. (#1110)
* 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
2021-05-27 12:15:16 +02:00
RSDuck e48e45db76 frontend: handle tablet and touch events
fixes #654 and #548
2021-05-24 20:23:06 +02:00
RSDuck 9181ab19c7 GPU3D soft: prevent out of bounds read 2021-05-24 19:41:24 +02:00
RSDuck f271bdf325 fix #906 2021-05-24 18:29:12 +02:00
WaluigiWare64 e02bbcb3ac Use printf macro for u64 2021-05-16 17:17:57 +01:00
Raphaël Zumer 4a39a84216
Propagate common ImportSRAM return value from NAND cartridge function (#1104) 2021-05-16 18:15:34 +02:00
Raphaël Zumer eb7bedfc79
Remove outdated frontend solar sensor code (#1102) 2021-05-16 17:18:24 +02:00
RSDuck 509107fb59 set instead of or stencil buffer for left edges 2021-05-08 00:12:48 +02:00
Arisotura 6f91bcc39f use shitfucking stupid linebreaks so that our text files don't like stupid compact blobs in Notepad
(really, fuck Notepad)
2021-05-06 00:40:11 +02:00
Arisotura d3c298bbe4 ASSFUCKING STUPID SHITPILE.
fixes #1044

(also add separator for cleaner menu)
2021-05-06 00:33:50 +02:00
Arisotura 50721719d2 GBACart: simulate open-bus decay roughly. fixes #1093 2021-05-04 12:58:59 +02:00
Arisotura b7d5a7db75 don't attempt to parse lines that failed to fetch 2021-05-03 17:02:38 +02:00
Arisotura 41cd092a15 NDSCart: enforce WR bit.
Bad Apple demo will break, because its NitroFS driver is broken. it needs a DLDI argv structure to exist in order to use its DLDI driver instead.
2021-05-03 14:58:45 +02:00
WaluigiWare64 2ff065e5ea Fix some compiler warnings 2021-05-03 13:40:44 +01:00
Arisotura cc36f55b8c Merge branch 'master' of https://github.com/Arisotura/melonDS 2021-05-02 21:19:12 +02:00
Arisotura e2e7f65f9f revised DLDI driver that uses the hardware somewhat more correctly 2021-05-02 21:18:52 +02:00
Nadia Holmquist Pedersen 464897ea87 Explicitly include ${SDL2_PREFIX}/include
this only accidentally worked before
2021-05-02 16:42:04 +02:00
Nadia Holmquist Pedersen d6036f9225 macOS-related CMake cleanups
* Remove useless explicitly specified link/include directories
* Don't pass -s or -pie to the linker as they aren't needed
2021-05-02 16:32:27 +02:00
Nadia Holmquist Pedersen b0e97b229e Fix minimum Darwin version for targeting 10.15 2021-05-02 14:34:44 +02:00
Arisotura 03bfbd2be7 fix touchscreen code in non-hybrid layout mode, fixes #1087
(also what the fuck is that code)
2021-05-01 19:09:01 +02:00
Arisotura 33a1bd3ac3 er, oops 2021-05-01 15:06:08 +02:00
Arisotura f219318292 Over the Hedge uses a tiny EEPROM, too.
fixes #899
2021-05-01 12:12:28 +02:00
Arisotura 18b1f79b44 Spider-Man 3 uses a tiny EEPROM, not a regular one 2021-04-30 22:59:50 +02:00
Arisotura 25ab02c650 fix another bad entry 2021-04-30 21:06:03 +02:00
Arisotura 414c608678 add ROMlist entry for Power Rangers Go-Busters (Korea) 2021-04-30 20:40:57 +02:00
Arisotura da9024e2b7 er, all cart types might want to have teh B8 command 2021-04-30 17:34:41 +02:00
Arisotura c2f37d44ce cart: ensure each set of commands can only be run in the correct command mode.
fixes #1083 (there was a chance an encrypted KEY1 command could be interpreted as something else and fuck things up)
2021-04-30 17:29:04 +02:00
Arisotura 5e648a8db3 fill most gaps in ROM list 2021-04-30 03:01:52 +02:00
Arisotura 8a5078abe3 support savemem for Face Training (NAND, atleast 32MB, likely 64MB) 2021-04-30 01:13:35 +02:00
Nadia Holmquist Pedersen 0a718adc77 Fix macOS right modifier detection.
Turns out my system was affected by a bug with modifier remapping in
macOS causing some of my left/right modifiers to be swapped. This commit
fixes them to be the correct values.
2021-04-29 19:45:41 +02:00
RSDuck 0a3a2ad009 fix aarch64 build with gcc 11 2021-04-29 15:15:16 +02:00
RSDuck eae42fb9f8 request repaint instead of update after each frame 2021-04-29 15:13:53 +02:00