- only use filestream_exists immediately before filestream_delete or
any other genuine filestream-related operations - when just checking
if a path exists on the filesystem, just use path_is_valid - faster
So this makes two basic changes:
1. Add a few extra dirs, hide root dir in the filesystem
2. Simplify the default dir selection code so it doesn't take three code blocks to change a dir
A few of the decisions here were weird.
This shouldn't affect anything for end users and makes the code more mantainable.
Log from the first run:
```
05-27 22:42:21.507 16529 16567 I RetroArch: jni_thread_destruct()
05-27 22:45:27.586 16992 17046 I RetroArch: [ENV] Android version (major : 7, minor : 1, rel : 2)
05-27 22:45:27.586 16992 17046 I RetroArch: [ENV] Checking arguments passed from intent ...
05-27 22:45:27.586 16992 17046 I RetroArch: [ENV]: config file: [/storage/emulated/0/Android/data/com.retroarch.aarch64/files/retroarch.cfg] -->correct
05-27 22:45:27.586 16992 17046 I RetroArch: [ENV]: current IME: [com.koushikdutta.vysor/.VysorIME]
05-27 22:45:27.586 16992 17046 I RetroArch: [ENV]: libretro path: [/data/user/0/com.retroarch.aarch64/cores/]
05-27 22:45:27.586 16992 17046 I RetroArch: [ENV]: android internal storage location: [/storage/emulated/0]
05-27 22:45:27.586 16992 17046 I RetroArch: [ENV]: android picture folder location [/storage/emulated/0/Pictures] -->cleanup no longer needed
05-27 22:45:27.586 16992 17046 I RetroArch: [ENV]: android download folder location [/storage/emulated/0/Download] -->cleanup no longer needed
05-27 22:45:27.586 16992 17046 I RetroArch: [ENV]: APK location [/data/app/com.retroarch.aarch64-2/base.apk]
05-27 22:45:27.586 16992 17046 I RetroArch: [ENV]: android external files location [/storage/emulated/0/Android/data/com.retroarch.aarch64/files]
05-27 22:45:27.586 16992 17046 I RetroArch: [ENV]: app dir: [/data/user/0/com.retroarch.aarch64]
05-27 22:45:27.586 16992 17046 I RetroArch: Testing permissions for /storage/emulated/0 -->correct
05-27 22:45:27.587 16992 17046 I RetroArch: Create /storage/emulated/0/.retroarch in /storage/emulated/0 true
05-27 22:45:27.587 16992 17046 I RetroArch: [ENV]: application location: [/data/user/0/com.retroarch.aarch64]
05-27 22:45:27.587 16992 17046 I RetroArch: [ENV]: default download folder: [] -->fixup
05-27 22:45:27.587 16992 17046 I RetroArch: [ENV]: default savefile folder: [/storage/emulated/0/RetroArch/saves] -->correct
05-27 22:45:27.587 16992 17046 I RetroArch: [ENV]: default savestate folder: [/storage/emulated/0/RetroArch/states] -->correct
05-27 22:45:27.587 16992 17046 I RetroArch: [ENV]: default system folder: [/storage/emulated/0/RetroArch/system] -->correct
05-27 22:45:27.587 16992 17046 I RetroArch: [ENV]: default screenshot folder: [/storage/emulated/0/RetroArch/screenshots] -->correct
05-27 22:45:27.780 16992 17046 I RetroArch: [recording] youtube streaming key empty
05-27 22:45:27.781 16992 17046 W RetroArch: Using old --libretro behavior. Setting libretro_directory to "/data/user/0/com.retroarch.aarch64/cores/" instead.
05-27 22:45:27.781 16992 17046 I RetroArch: RetroArch 1.7.7 (Git 772d06f)
```
Also these are changed:
![image](/uploads/c7a68118e9d91567b135ded551f571ee/image.png)
Should be easier to navigate to other mountpoints
- Disable VFS for now - seems to be very problematic right now
- Move uwp_is_path_accessible_using_standard_io to file_path.c
since it seems to have no VFS dependencies, and rename it to
is_path_accessible_using_standard_io so it could possibly be later
used for other platforms as well that also have sandboxed filesystems
-Remove switch_pthread - It should be no longer used
-Increase SAVE_STATE_CHUNK to 4MB
-Fix overclocking on Horizon 8.0+
Note: This requires the updated Toolchain before Merge
- Add optional timestamped log files
- Handle errors if log file cannot be opened
- Android: flush log file immediately
- 3DS: log to file tested and fully working
- Default log paths added for all platforms
- add tvOS target
- support code signing tvOS cores by adding an argument to the code signing cores script
- use NSCachesDirectory for the documents directory
- add some mfi controller handling logic to set non-game controllers to the last index to avoid interfering with operation
- autodetect mfi controller for apple tv on startup - added autodetect to hid joypad
- added a webserver to transfer files for tvOS
- xcode: clean up project, remove unused folders
- remove HAVE_MATERIALUI setting for tvos build, make it use XMB as default
- added retroarch app icon courtesy of @MrJs
- added auto-detect of mfi controller for apple tv
This allows optionally sorting configure files and is needed to fix the
order of inputs in the autoconfig profiles which should not be sorted
alphabetically.
Fixes https://github.com/libretro/RetroArch/issues/7873
== DETAILS
For local netplay, it's useful to have your IP address easily
available. This commit makes the Information > Network Information
menu display the Wii U's IP address.
Change summary:
- Fix the logging init to be reentrant to avoid socket consumption
- Add implementation of POSIX `getifaddrs()` and `freeifaddrs()`
to `missing_libc_functions.c`
- Remove compiler directives protecting the code paths that call
`getifaddrs()` from being used in Wii U builds
== TESTING
Have tested locally, successfully get IP address information in
the Information > Network Information.
I think this may also fix NAT traversal. Will need to be tested.
- Did a test build to ensure RA built
- Copied over to my FTPservU sources and ensured no compile issues there
Looks solid. A lot cleaner, too.
@aliaspider
I used the code in `wiiu/` to bootstrap my own WiiU homebrew app; this
PR reflects some changes I needed to make, that might be useful upstream.
1. Clean up filesystem initialization
Filesystem driver initialization was lumped in with filesystem mounting;
and that was a problem in my project, because I needed to be able to remount
the SD card on the fly. So, now it's split up.
I've added a callback object named "hooks" that can be used by consuming
applications to handle filesystem mounting and unmounting. If these hooks are
not provided, then the existing default behavior occurs.
2. Expand socket handling
- add `SO_NONBLOCK` flag for non-blocking socket I/O
- add normal errno defines like `EWOULDBLOCK` `EAGAIN`.
3. Remove RetroArch dependencies
- the exception handler protects usage of version_git with
`#ifdef HAVE_GIT_VERSION` but not the include, so I added that.
It also technically depends on version.h, but I'm not touching that.
It's easy enough to implement and I needed the same functionality. I'm
not sure what the best solution for that dependency is.
- missing_libc_functions.c included features/features_cpu.h which is
a libretro include. This appears to be a stale include though, because
everything compiles and works without it.
- an ifdef referencing the RA "WIIU" define, rather than the devkitpro
"__wiiu__" define
== DETAILS
We had some disagreement on what packet size to use.
The maximum packet size varies depending on the actual network
hardware in use; the typical Ethernet value is relatively safe,
but not 100% compatible.
RFC 791 does, however, define a minimum datagram size that all
IP hosts must be able to handle--and it's large enough for our
needs, since we're generally not writing more than maybe 100
bytes at a time anyway.
I also did a little bit of cleanup for readability.
== DETAILS
The broadcast address is a standard part of TCP/IP that is used to
send messages to everyone on the subnet. This patch updates the
logging code to do the following:
1. Derive the broadcast address from the Wii U's own IP address
and subnet mask. These can all be obtained at runtime, which
means we can...
2. Remove the PC_DEVELOPMENT_IP_ADDRESS define from Wii U's
Makefile, because compiling in an IP is no longer needed.
3. Rewrite the net_listen script to listen for broadcast packets
and print them out with timestamps.
Since it's using the broadcast address, the only requirement is
that the PC be on the same network subnet as the Wii U.
Because of the low overhead of UDP, I've made logging on by
default. This will make it a ton easier to get useful bug
reports from users.
- move non-salamander objects out of salamander scope
- move the missing libc functions to general scope
- fix salamander_main inline invocation
TESTING: Ran 'make -f Makefile.wiiu SALAMANDER=1' successfully
=== DETAILS
Since @aliaspider wants the `wiiu/` to be something of a mini-SDK, I've
reorganized the code I put in there:
- `wiiu/main.c` now only has the ELF/RPX entrypoints, and the code used
by those entrypoints, with RA code removed (e.g. swapped retro_sleep()
for usleep()). These entrypoints then call main() ...
- Moved `main()` and its support functions back into `frontend/drivers/platform_wiiu.c`
I also renamed some of the support functions I wrote, and better
organized them within the code.
- Moved `wiiu/input/` into the `input/` hierarchy:
* The joypad drivers now live in `input/drivers_joypad/wiiu/`
* The HID driver now lives in `input/drivers_hid/`
* The Wii U specific headers now live in `input/include/wiiu`
* I added `input/include` into the include search path to avoid
using really ugly relative includes
== DETAILS
The Wii U main entrypoints were embedded in the frontend driver,
which isn't a great place for them. Also, the `main()` method was
pretty long and monolithic. Now it's (much) less so.
Changes:
- Refactor out the main entrypoints into their own source files
(`wiiu/main.c` and `wiiu/main.h`)
- Optimize includes in both files, so only the minimum needed to
compile are included.
- The `main()` method is a lot easier to understand now. It's no longer
a confusing mess of ifdefs.
- There's a small amount of changes in the headers for future work, which
is switching kpad_driver to be callback-driven. The only change here is
to import the function that will be used, and define some data types.
Testing:
- Did local builds and confirmed build is successful
- Successfully loaded a core and switched among a few games
Add some timing functions so that we can know the time (woo-hoo?)
I use errno here, which worries me a bit. I wouldn't put it past
devkitPPC to have it as a null pointer or something.
Can confirm this makes XMB's clock work, much to @cucholix's delight;
I'm sure ;D
Also fix white spaces in led drivers, make led drivers use standard driver format.
Begin work on translation driver.
Add salamander files to gitignore.
== DETAILS
We're trying to track down the source of crashes when switching cores.
To rule out the HID code, this commit does the following:
- Wraps the library imports in an ifdef
- Wraps the object files in conditionals in Makefile.wiiu
- In wiiu_joypad, calls into the hidpad driver are wrapped in ifdef
== TESTING
This didn't solve the "System memory error" crash I've been experiencing.
But, maybe it will impact the other flavors of crashes others are seeing.
== DETAILS
The old code was crashing; I did a minimalized branch and the crash
went away, so I'm bringing that over here. Meaning I'll have to
redo some of the other work I'd put in, but oh well.
(now watch it start crashing again)
== TESTING
Can confirm it builds. Wii U is busy ATM so I can't test.
== DETAILS
I did a minimalist edit of the HID thread that stripped out all
HID* syscalls, and this stopped the crashing. I then re-added just
the HIDSetup() and HIDTeardown() calls, and the crash came back.
This smells like an OS bug. To work around it, I've put the
HIDSetup() and HIDTeardown() calls into the app init/shutdown
section, so they only get called once in the application lifetime
and not each time the input driver is initialized.
== DETAILS
We discovered that the controller_patcher code was causing
the WiiU to intermittently crash when switching ROMs.
Changes:
- Completely extricates the controller_patcher code
- Create a skeleton wiiu_hid driver
- Wire up the build system to build/link it successfully
== TESTING
Has not been tested. Probably doesn't crash, since the
skeleton driver is just a copy of the null driver.
As discussed in libretro#5357; controller_patcher is now optional. It's
off by default; though this could be changed with a simple makefile
tweak (ENABLE_CONTROLLER_PATCHER ?= 1, perhaps?)
To re-enable controller_patcher; append ENABLE_CONTROLLER_PATCHER=1 to
your usual make command.
controller_patcher was the only user of c++ constructors in the Wii U
port, so you'll need 26a006c in your tree otherwise you will have a
blackscreen on startup.
The old setup relied on there being at least one constructor *or* the
value of *__CTOR_LIST__ being NULL. Neither of these are guaranteed; and
having no C++ constructors actually resulted in a random value being
read (which passed the NULL check!). This new setup uses the
__CTOR_END__ symbol; which is a pointer to just after the end of the
list. When there are no constructors, it has the same value as
__CTOR_LIST__; so the while loop is never entered.
This fix also allows us to re-enable destructors; in case they're ever
needed.
CFSearchPathForDirectoriesInDomains returns a path in /var, while
getenv(HOME) returns the same path in /private/var. /var is a symlink
to /private/var, but when config is generated, the difference in paths
means they won't be abbreviated correctly.
This change expands symlinks before filling in the default
directories, so those paths will match.