Commit Graph

30 Commits

Author SHA1 Message Date
Jesse Talavera-Greenberg b078ca802f
Expose SRAM pointers for frontends that manage save data their own way (#1643)
* Add a clarifying comment

- In case it saves some poor bastard hours of fruitless work

* Expose GBA and NDS save memory

- Add GetSaveMemory and GetSaveMemoryLength functions
- Where unsupported, they return null and zero
2023-03-27 22:36:26 +02:00
Jesse Talavera-Greenberg 79dfb8dc8f
Introduce `Platform::Log` (#1640)
* Add Platform::Log and Platform::LogLevel

* Replace most printf calls with Platform::Log calls

* Move a brace down

* Move some log entries to one Log call

- Some implementations of Log may assume a full line

* Log the MAC address as LogLevel::Info
2023-03-23 18:04:38 +01:00
Arisotura 9394dde67a fix copyright headers 2022-03-07 21:08:54 +01:00
Arisotura ef7dfb8872 fix the GBA cart save shito, I guess 2022-03-04 20:54:45 +01: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 50721719d2 GBACart: simulate open-bus decay roughly. fixes #1093 2021-05-04 12:58:59 +02:00
WaluigiWare64 2ff065e5ea Fix some compiler warnings 2021-05-03 13:40:44 +01: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
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 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
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
Raphaël Zumer 22d11209b0 Split GBA Reset and Eject logic into two sets
This allows solving some crashes and provides more
flexibility in how GBA cartridges change state between
soft and hard resets. Since save states including GBA
data do not carry over the original save file path,
and the GBA cartridge is being reset along with the other
parts of the system, this is needed to avoid losing
the GBA state on reset following a state load, while
preserving the behavior where cartridges are ejected
when calling Stop().
2019-12-22 16:01:13 -05:00
Raphaël Zumer f380767fab Only store the GBA ROM header in save states
Also fix some potential crashes due to SRAM
state not being cleared correctly on state load.
2019-12-22 14:13:10 -05:00
Raphaël Zumer a57ba1368e Skip saving/loading GBA flash state if SRAM is null 2019-12-22 11:45:11 -05:00
Raphaël Zumer 2abdcc54dd Implement DoSavestate() for GBACart classes
Admittedly untested.
2019-12-19 00:12:40 -05:00
Raphaël Zumer 8172cbc170 Add DoSavestate() function to GBACart_SolarSensor
Still empty, but should be implemented along with the rest.
2019-12-18 23:35:14 -05:00
Raphaël Zumer f257b007a2 Properly pass through GBA GPIO writes 2019-12-10 19:10:14 -05:00
Raphaël Zumer ca9f183d24 Hook up solar sensor control to the UI
It uses hardcoded keypad left and right arrows.
2019-12-10 17:54:35 -05:00
Raphaël Zumer f6cd66e5b1 Implement solar sensor processing 2019-12-10 17:43:25 -05:00
Raphaël Zumer 9128517b90 Add basic GBA GPIO support, solar sensor detection 2019-12-10 16:36:39 -05:00
Raphaël Zumer 0092937148 Rename SRAMFlash to SRAMFlashState 2019-12-10 16:36:00 -05:00
Raphaël Zumer 4d1f3d419e Clarify comments and credit DeSmuME for Flash I/O 2019-12-10 09:57:15 -05:00
Raphaël Zumer 68d3474458 Fix GBA Flash read/writes and clean up 2019-12-09 07:37:09 -05:00
Raphaël Zumer 8fc9a33a9f Implement GBA cartridge Flash reading and writing 2019-12-09 06:10:26 -05:00
Raphaël Zumer 4e8b0c8ce4 Eject GBA cartridges on stop from the UI 2019-12-09 06:09:30 -05:00
Raphaël Zumer 5ad85f15c1 Add a framework to support non-SRAM GBA saves
The support is not yet there, but at least
we should not read or write bogus data.
2019-12-09 04:58:54 -05:00
Raphaël Zumer 62b9f51e23 Handle GBA cartridge SRAM writes 2019-12-08 21:20:01 -05:00
Raphaël Zumer 48a8a25548 Reset GBA cartridge state when loading a new ROM 2019-12-08 17:13:56 -05:00
Raphaël Zumer d86ee1d5bf Add GBA cart model and allow reading from it 2019-12-08 15:30:07 -05:00