Commit Graph

17 Commits

Author SHA1 Message Date
Jesse Talavera
c6bf5d5181
Allow AREngine to be used independently of ARCodeFile (#2108)
* Make `EmuInstance::cheatFile` use a `unique_ptr`

- Fixes a memory leak, as the cheat file wasn't cleaned up in the destructor

* Split `AREngine` and `ARCodeFile` apart

- Suitable for frontends that have their own way of storing cheats
- Store the cheats in `AREngine` in a `std::vector`
- Apparently cheats are _supposed_ to be executed each frame; I didn't understand this until recently
2024-08-01 22:01:00 +02:00
Arisotura
8fc403cdad update copyright headers 2024-06-15 17:01:19 +02:00
Jesse Talavera-Greenberg
346dd4006e
Move all core types into namespaces (#1886)
* Reorganize namespaces

- Most types are now moved into the `melonDS` namespace
- Only good chance to do this for a while, since a big refactor is next

* Fix the build
2023-11-25 18:32:09 +01:00
Arisotura
ac38faef14 update copyright years 2023-11-04 00:21:46 +01:00
Arisotura
bff7a0d114 make linebreaks in text files not weird 2023-11-02 12:40:49 +01:00
StraDaMa
bc71618457
remove AR code size limit (#1802)
Co-authored-by: Arisotura <thetotalworm@gmail.com>
2023-08-27 13:34:11 +02:00
Jesse Talavera-Greenberg
ee55677086
Assorted portability enhancements (#1800)
* Introduce some Platform calls for managing dynamic libraries

* Add Platform::WriteFATSectors

* Introduce some Platform calls for managing dynamic libraries

* Add Platform::WriteFATSectors

* Change includes of "../types.h" to "types.h"

- Makes it easier to directly include these headers in downstream projects

* Change an include of "../Wifi.h" to "Wifi.h"

* Allow CommonFuncs.cpp to compile on Android

* Tidy up some logging calls

- Use Platform::Log in LAN_Socket.cpp
- Soften some warnings to Debug logs (since they don't necessarily represent problems)

* Add Platform::EnterGBAMode

- Gracefully stop the emulator if trying to enter GBA mode

* Soften some logs that most players won't care about

* Soften some more logs

* Introduce Platform wrappers for file operations

* Fix pointer spacing

* Fix more style nits

* Log the errno when ftruncate fails

* Fix FileSeek offset argument

- With an s32 offset, we couldn't access files larger than 2GB

* Revise Platform::StopEmu to address feedback

- Remove Platform::EnterGBAMode in favor of adding a reason to Platform::StopEmu
- Also rename Platform::StopEmu to Platform::SignalStop
- Add an optional argument to NDS::Stop
- Use the new argument everywhere that the console stops itself

* Rename FileGetString to FileReadLine

- It conveys the meaning better

* Rename FileSeekOrigin::Set to Start

- It conveys the meaning better

* Change definition of FileGetString to FileReadLine

- Oops, almost forgot it

* Rename FlushFile to FileFlush

- To remain consistent with the other File functions

* Add a FileType usage

* Fix line break in FileSeekOrigin

* Document Platform::DeInit

* Clarify that StopReason::Unknown doesn't always mean an error

* Move and document FileType::HostFile

* Remove Platform::OpenDataFile

- Nothing currently uses it

* Refactor Platform::OpenFile and Platform::OpenLocalFile to accept a FileMode enum instead of a string

- The enum is converted to fopen flags under the hood
- The file type is used to decide whether to add the "b" flag
- Some helper functions are exposed for the benefit of consistent behavior among frontends
- Equivalent behavior is maintained

* Fix a tab that should be spaces

* Use Windows' 64-bit implementations of fseek/ftell

* Move Platform::IsBinaryFile to Platform.cpp

- It could vary by frontend

* Remove an unused FileType

* Rename an enum constant

* Document various Platform items

* Use Platform::DynamicLibrary to load libandroid

- And clean it up at the end

* Fix a typo

* Pass the correct filetype to FATStorage

- Since it can be used for DSI NAND images or for SD cards

* Remove Platform::FileType
2023-08-18 22:50:57 +02:00
RSDuck
4b170b94d5 pointless micro optimisations 2023-04-28 17:05:34 +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
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
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
b7d5a7db75 don't attempt to parse lines that failed to fetch 2021-05-03 17:02:38 +02:00
WaluigiWare64
2ff065e5ea Fix some compiler warnings 2021-05-03 13:40:44 +01:00
RSDuck
436b3c4c1d update copyright year and add missing GPL headers 2021-03-12 20:07:40 +01:00
Arisotura
f8d1d08e9c (finally) build the goddamn cheat interface 2020-08-15 00:14:05 +02:00
Arisotura
4cefff2528 add AR code file parser and shit 2020-08-13 00:20:34 +02:00