Commit Graph

1504 Commits

Author SHA1 Message Date
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
Nadia Holmquist Pedersen cffffa887e macOS: Assign "Preferences..." to emu settings without also removing it from the config menu 2021-04-27 15:11:15 +02:00
Tatsh 5a9063089c
Savestate: use Platform::OpenLocalFile (#1026) 2021-04-26 23:21:58 +02:00
Arisotura 6691c6903b asfdasdas you'd better not give me shit now 2021-04-26 16:43:25 +02:00
Arisotura a2c12f7e66 fix some more case sensitive shito 2021-04-26 15:50:02 +02:00
Arisotura 1afb8bfa46 that game is actually a tiny EEPROM 2021-04-26 15:30:00 +02:00
Arisotura bf4052bc3d more of the same (actually fix the bug I was having) 2021-04-26 15:25:45 +02:00
Arisotura 4a5d5116a1 make extension checks case-insensitive 2021-04-26 15:20:28 +02:00
Arisotura 7ab19f157d add ROM entry for Clueless Fashion (#1050) 2021-04-26 13:23:29 +02: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
Arisotura f8bb1aa98d 'aight 2021-04-25 11:54:08 +02:00
Arisotura 18497d396d add more Mac crap. hoping the weird characters made it through. 2021-04-25 11:53:29 +02:00
Arisotura 185c97f4ef try to cover right-mod keys under MacOS I guess 2021-04-25 11:34:56 +02:00
Arisotura 9d9865d256 hopefully remove shitty hack 2021-04-25 11:09:16 +02:00
Nadia Holmquist Pedersen a860c5fbd3 Actually use the new script... 2021-04-25 03:55:01 +02:00
Nadia Holmquist Pedersen bc4a156a4d More 10.14 fixes also make the version check in cmakelists actually work 2021-04-25 03:51:04 +02:00
Arisotura 1846a71265
Cart refactor (#1073)
complete cart-interface refactor, will make this code a lot easier to deal with
2021-04-25 00:48:02 +02:00
Nadia Holmquist Pedersen 0834fc1533
Add support for building with Qt6 (#865)
Co-authored-by: WaluigiWare64 <68647953+WaluigiWare64@users.noreply.github.com>
2021-04-24 13:30:10 +00:00
Nadia Holmquist Pedersen 796ef95862
Improve macOS bundling (#1067)
* Improve macOS bundling
* Bundle libs for macOS CI
* Add MACOS_BUILD_DMG CMake option and make the CI upload the DMG so we don't lose executable permissions.
* Manually copy plugins if macdeployqt doesn't
* Ad-hoc codesign the app
2021-04-21 23:50:32 +02:00
Nadia Holmquist Pedersen 06e2193c04 Fix up menu roles a bit 2021-04-19 09:18:50 +02:00
Arisotura d5dbef2c22 make path inputs support drag/dropping files onto them to add the path quickly. fixes #1033 2021-03-29 01:08:22 +02:00
Arisotura 284a9b73b0 keep recent filenames from being absurdly long in the menu 2021-03-27 01:54:55 +01:00
WaluigiWare64 2c2e868de0 Disable JIT write-protect when de-initialising on ARM64 macOS 2021-03-22 20:14:21 +00:00
WaluigiWare64 ac49d8e25c Update copyright year and add missing GPL headers part 2
Looks like a lot of files were missed...
Closes #1036
2021-03-21 21:32:26 +00:00
WaluigiWare64 6b431a6664
Allow bundling libraries on macOS (#1013) 2021-03-21 15:32:23 +00:00
RSDuck f060162dac attempt at fixing #1037 2021-03-17 16:44:54 +01:00
RSDuck fbe691a673 fix read from unassigned variable for large BGs 2021-03-16 20:57:30 +01:00
RSDuck 436b3c4c1d update copyright year and add missing GPL headers 2021-03-12 20:07:40 +01:00
RSDuck bc63531e00 avoid leaking threads in NDSCart_SRAMManager
also atomics
2021-03-11 16:54:43 +01:00
RSDuck 6a3aa551da remove direct reference to Switch frontend header 2021-03-03 00:43:56 +01:00
RSDuck 41dd448e28 call Renderer2D::VBlankEnd at vblank end
instead of vblank start
2021-03-01 04:06:11 +01:00
RSDuck a046eb5038 separate GPU2D registers and renderer 2021-02-27 22:25:42 +01:00
WaluigiWare64 89051f63d4
Define CONTEXT_PC and use instead for much cleaner code (#1017)
* Define CONTEXT_PC and use instead for much cleaner code

Also include ways to get the Program Counter on ARM64 FreeBSD and NetBSD
2021-02-25 21:17:11 +00:00
WaluigiWare64 68da2ace58 Include winsock2.h before windows.h 2021-02-23 18:15:02 +00:00
SuuperW 94dcc9523e
SRAM things (#970)
* Allow SRAMManager to save to/load from a buffer.

* Don't delete what doesn't exist. Don't create a thread that will do absolutely nothing.

* Update SRAMManager's SecondaryBuffer when loading a savestate.
2021-02-23 02:46:02 +01:00
RSDuck 58dd1ec580 directly set VRAMDirty for VRAM BG/OAM writes 2021-02-23 02:09:18 +01:00
Nadia Holmquist Pedersen 97643586fa
Fix OpenGL display scaling on high DPI (#1011)
* Fix OpenGL display scaling on high DPI

* Scale the OSD too

* Fix indent
2021-02-22 18:17:48 +01:00
WaluigiWare64 532dc57025
Fix the JIT Code Memory on ARM64 Macs (#916) 2021-02-22 15:13:39 +00:00
RSDuck 0aa0ae6c69 fix #1010 2021-02-22 02:38:21 +01:00
wheremyfoodat 03b465c5e2
Fix edge case in the division engine, fix edge case in the CPU (#1003)
* 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)
2021-02-19 23:58:41 +01:00
WaluigiWare64 712919ec41
Remove unneeded OpenGL loading function code (#1006) 2021-02-17 20:53:07 +00:00
RSDuck 64c6654d94 use syncs instead of glFinish 2021-02-16 15:00:23 +01:00
RSDuck 295d60e4cb try to fix build when the compiler is stricter 2021-02-11 19:11:18 +01:00
RSDuck f1e0816c1a detach and delete shaders directly after linking 2021-02-11 18:38:52 +01:00
RSDuck f05bc50d40 use std::function in Thread_Create so we can revert back to using it 2021-02-11 16:00:36 +01:00
gal20 d63f7977f8
Remove code duplication in `onChangeScreenSize` (#968) 2021-02-09 23:42:31 +01:00
Wunk a7029aebae
Allow for a more modular renderer backends (#990)
* 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.
2021-02-09 23:38:51 +01:00
RSDuck 891427c75c fix #994 2021-02-09 23:36:46 +01:00
RSDuck e7ee3b7bc8 wild shot into the dark 2021-02-09 22:19:44 +01:00
RSDuck 6256a42e00 improve and fix NonStupidBitfield also get rid of some UB
fixes optimised lto clang build
2021-02-09 19:24:57 +01:00
WaluigiWare64 2502c8d212
Add NetBSD support (#985)
Note - This will require PaX MPROTECT to be disabled for melonDS by running:
paxctl +m melonDS
2021-02-03 16:14:53 +00:00
RSDuck 7b9b8418cb fix #978 2021-02-02 20:37:28 +01:00
RSDuck 2e999ae1b8 attempt at fixing #972 2021-02-02 16:29:23 +01:00
RSDuck 40aae154cf prevent race condition around framebuffers 2021-02-02 15:33:45 +01:00
WaluigiWare64 f9e701a719
Initialise cursor hiding timer before potential deletion of ScreenPanelGL 2021-01-29 16:05:51 +00:00
RSDuck a3f4aaf503 call glFlush only once
that seems to atleast get rid of the flicker
the weird issue that clears don't work is still there
2021-01-29 12:38:31 +01:00
Nadia Holmquist Pedersen b75b3f69b7
Don't save the window size to the config if in full screen (#933) 2021-01-27 00:14:24 +01:00
RSDuck 4a28068295 the rasteriser doesn't have to be done on line 144
thanks to the VRAM cache
2021-01-26 19:05:21 +01:00
RSDuck aceabe92e6 fix recent regression in screen layout calculation 2021-01-26 18:19:25 +01:00
RSDuck b78bc4cb66 fixes to the threadedness of the sw rasteriser
also fix #639 and fix #880
2021-01-26 16:42:27 +01:00
WaluigiWare64 ab222ab135
Use libepoxy to load in OpenGL functions (#960)
* Use libepoxy to load in OpenGL functions

Prevents having to load them in manually

* Install libepoxy in the CI

* Do not link OpenGL libraries, libepoxy opens them itself

* Add libepoxy to build instructions
2021-01-26 13:19:32 +00:00
gal20 54b1a752d4
Add hybrid layout (#772) 2021-01-25 19:47:54 +01:00
WaluigiWare64 43348210f9 Fix some compiler warnings 2021-01-25 14:12:13 +00:00
RSDuck b9a56bc4e4 more screen modes
- add support for different aspect ratios
- add support for displaying only one screen at once
2021-01-24 22:32:13 +01:00
WaluigiWare64 536902d610 Fix crash if OpenGL version is lower than requirements 2021-01-24 15:44:05 +00:00
WaluigiWare64 9994d3a644
Add FreeBSD support (#939)
* Add FreeBSD support

* Fix indentation

* Fix Linux not finding OpenGL

* Link POSIX Realtime Extensions library

* Link POSIX Realtime Extensions when OpenGL is enabled too

* Fail if shm_open memory exists and also check for errors

* fix the last commit

* (try to) Setup FreeBSD CI

* Fix some issues with FreeBSD CI

* Make with all cores

* Remove FreeBSD CI 

It doesn't want to work for some reason
2021-01-22 19:20:32 +01:00
SuuperW 34da7f5cc3
minor code refactoring, to simplify BizHawk support (#958) 2021-01-22 19:05:07 +01:00
WaluigiWare64 f259fd9755 fix again 2021-01-22 17:40:56 +00:00
WaluigiWare64 5dd94f5ec1 fix last commit 2021-01-22 17:38:30 +00:00
WaluigiWare64 faf7cf752d Add option to pause emulation when focus is lost
Fixes #875
2021-01-22 17:35:13 +00:00
RSDuck 8a3a8b7c68 include polygon attr opaqueness for translucent polygons in render key 2021-01-22 12:19:51 +01:00
Madhav Kanbur 1e4c0c9d72
Polish up archive support (#930)
* 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 c8af6f066f.
2021-01-22 11:22:32 +01:00
SuuperW d42ca1ec4b
Implement "lag frame" flag and counter (#949)
* 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.
2021-01-21 21:26:27 +01:00
Arisotura 8a068c2294 GL: ensure to set depthmask to TRUE before rendering opaque shit 2021-01-21 21:10:43 +01:00
WaluigiWare64 bf0ea26596
Add option to hide mouse on inactivity (#955)
Also allow user to specify how long to wait before hiding
2021-01-21 19:48:25 +01:00
RSDuck 1494d7aa24 fix ARM64 again 2021-01-21 15:32:02 +01:00
RSDuck 3b994fe892 fix last commit for ARM64 2021-01-20 18:01:21 +01:00
RSDuck 771dfaca2e JIT: handle STR post with rd == rn
fixes Zelda Four Swords
2021-01-19 23:50:08 +01:00
WaluigiWare64 e8f06b8ac1 Define melonDS version in CMake
Prevents having to update multiple files (melon.rc, melon.plist, version.h) when a new version is released.
2021-01-19 11:39:25 +00:00
gal20 cd6859ef6f
Add hotkey to swap screens (#953) 2021-01-18 22:51:39 +01:00
RSDuck d529b650c0 implement swapping the position of both screens
closes #855
2021-01-17 22:16:32 +01:00
RSDuck 1d6cc3c6ef keep only one handle of the NAND file around 2021-01-17 19:56:02 +01:00
RSDuck 53d5def919 pad ShaderConfig to a multiple of 16 2021-01-17 17:15:03 +01:00
WaluigiWare64 c109235d01
Also include Homebrew on ARM64 Mac location in CMake (#938) 2021-01-11 23:01:23 +01:00
Ben Morris b402cb19b2
quit on sigint (#934)
* quit on sigint

* formatting
2021-01-10 03:48:40 +01:00
Kimmy Andersson bf97387f26
Improved SRAM performance (#925)
* 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
2021-01-09 22:18:57 +01:00
RSDuck 6b306e18a5 handle edge cases properly 2021-01-09 22:06:15 +01:00
RSDuck c475372372 mask off upper bits when incrementing RX addr
fixes #931
2021-01-09 18:31:12 +01:00
RSDuck 7081c2de65 readd vram invalidation through display capture
also remove stray printf
2021-01-07 22:39:36 +01:00