Commit Graph

60 Commits

Author SHA1 Message Date
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
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
Charlene Campbell
c4cd9da674 don't link rt when oglrenderer disabled on apple 2021-12-29 18:28:27 +01:00
Arisotura
19ddaee13b finally decouple Config from the core. baahhahahahah 2021-11-18 01:17:51 +01: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
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
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
235da420c8
having fun with fatfs (#1189)
* patch TSC coords in DSi mode
* DSiware importer and shit
2021-08-24 17:46:20 +02:00
RSDuck
6944fdbe78 add support for JIT profiling with VTune 2021-07-24 16:20:03 +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
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
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
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
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
WaluigiWare64
c109235d01
Also include Homebrew on ARM64 Mac location in CMake (#938) 2021-01-11 23:01:23 +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
23b1a231cb change cmake file as well 2020-12-07 18:36:14 +01:00
RSDuck
b80d5a04f3 lay base for multiple GPU2D backends 2020-12-06 17:40:16 +01:00
webgeek1234
298b958e2a
Rename jit linkage asm files (#836)
An extension of lower case s indicates to not run the
preprocessor while upper case S does. These files have defines.
2020-12-01 19:48:46 +01:00
WaluigiWare64
7da4550eea
Add support for macOS (#771)
* use shm_open() instead of memfd_create() on macOS

malloc.h isn't a header on macOS

* Change OpenGL headers + create ifdef for DO_PROCLIST

macOS seems to already have the OpenGL functions defined, without the ifdef, it gives "ambiguous references" errors.

* macOS doesn't have ->gregs in uc_mcontext

and it doesn't have REG_RIP either
https://github.com/gperftools/gperftools/blob/master/m4/pc_from_ucontext.m4

* use getpid() to make memory file name unique

* #ifndef __APPLE__ for AF_PACKET and linux/if_packet.h

* Add include and link directories for macOS and link the OpenGL framework

* Add macOS CI

* Use newly added libslirp package from Homebrew

https://github.com/Homebrew/homebrew-core/pull/63412

* Use Apple's Clang instead of GNU GCC on macOS

* Add macOS build instructions to README

* Try to fix macOS undefined symbol

* snprintf doesn't take null terminator into account

* Map new memory on macOS for JIT

* Only use gcc-ar if using GNU Compiler

* re-add fastmem code - whoops!

* Fix style issue - use camelCase not snake_case

* Set Minimum macOS version

* Switch Minimum OS X version to 10.9

* Add macOS libpcap library name

* fix memory leak

* Fix binding keys in macOS

* Allow getting MAC address on macOS

melonDS on Linux uses AF_PACKET, which doesn't exist on macOS. Instead, this commit uses AF_LINK on macOS to get the MAC address.

* Remove unneeded macOS CI dependencies

* Build melonDS app bundle on macOS

Now it is no longer required to install the libraries on macOS, they come with the app bundle.

* fix macOS CI not being able to find macdeployqt

* copy melonDS.app with recursive because it's a folder

* Disable fastmem checkbox on macOS

* Disable fastmem by default in config

* forgot a semicolon

* Don't bundle libraries, causes issues on macOS <10.15

* Update README + allow finding version in Finder on macOS

* Make sure fastmem checkbox stays uncheckable
2020-11-29 17:11:33 +01:00
RSDuck
6977302403 make OpenGL renderer a build option
mostly meant for the Switch port
2020-10-01 00:01:05 +02:00
Arisotura
5431c469c3 actually add DLDI. bahahahhh 2020-09-03 20:28:07 +02:00
Arisotura
4cefff2528 add AR code file parser and shit 2020-08-13 00:20:34 +02:00
RSDuck
961b4252e2 Make it buildable on aarch64 2020-07-23 19:07:33 +00:00
RSDuck
e335a8ca76 first steps in bringing over the JIT refactor/fastmem 2020-06-16 12:11:19 +02:00
RSDuck
e7d076403d Merge branch 'generic_jit' of https://github.com/Arisotura/melonDS into generic_jit 2020-06-16 12:06:42 +02:00
RSDuck
6d217e1010 fix build with JIT disabled and set default JIT maxblock size to 32 2020-06-16 11:59:09 +02:00
RSDuck
1c07932b40 implement block linking + some refactoring
currently only supported for x64
2020-06-16 11:59:06 +02:00
RSDuck
5ab56cef5f this mistake was phenomally stupid 2020-06-16 11:57:57 +02:00
RSDuck
99b34efe2d move ARM64 JIT backend here 2020-06-16 11:57:51 +02:00
RSDuck
86f2be7260 jit: add compile option 2020-06-16 11:54:03 +02:00
RSDuck
83bd863361 jit: branch instructions 2020-06-16 11:53:09 +02:00
RSDuck
550e6b86d2 JIT: compilation of word load and store 2020-06-16 11:53:07 +02:00
RSDuck
2f6b46fd4f JIT: implemented most ALU instructions 2020-06-16 11:53:06 +02:00
RSDuck
c692287eba JIT: base
all instructions are interpreted
2020-06-16 11:53:05 +02:00
Arisotura
b62d90cbe4 Merge remote-tracking branch 'remotes/origin/master' into melonDSi 2020-05-30 03:19:20 +02:00
Arisotura
2327de2423 Merge commit '4b57416552ec2fa95216e2b044559f215723bf70' into melonDSi 2020-05-30 03:12:42 +02:00
Arisotura
c45068da0e embed romlist.bin 2020-05-30 00:28:21 +02:00
Arisotura
36f4cdbbbf get the OpenGL renderer going.
sorta.

(also make the blackmagic_II branch obsolete in the process)
2020-05-25 18:25:50 +02:00
Arisotura
aa4344e249 add audio output. HARK HARK HARK 2020-05-02 20:25:39 +02:00
Arisotura
931da1c66f add a bunch of code 2020-04-27 22:02:45 +02:00
Arisotura
690f9f3874 get some of the shit going, I guess
atleast the emuthread is going and we have its control system down

and other fun shit, too
2020-04-27 12:06:44 +02:00
RSDuck
47b44a6be8 fix build with JIT disabled and set default JIT maxblock size to 32 2020-04-26 16:27:26 +02:00
RSDuck
3787bab1f6 implement block linking + some refactoring
currently only supported for x64
2020-04-26 13:05:17 +02:00
RSDuck
0280fbe194 this mistake was phenomally stupid 2020-04-26 13:05:14 +02:00
RSDuck
d6cc7de6c4 move ARM64 JIT backend here 2020-04-26 13:05:09 +02:00
RSDuck
411fb57c07 jit: add compile option 2020-04-26 13:03:06 +02:00
RSDuck
c58fdbd66b jit: branch instructions 2020-04-26 13:02:58 +02:00
RSDuck
5f932cdf48 JIT: compilation of word load and store 2020-04-26 13:02:56 +02:00
RSDuck
ebce9f035f JIT: implemented most ALU instructions 2020-04-26 13:02:55 +02:00