Overview
| Comment: | Add initial socket code for Nintendo Switch
This doesn't work yet (it crashes on recvfrom), so it's not enabled in |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | nintendo-switch |
| Files: | files | file ages | folders |
| SHA3-256: |
a30a0ab261acffd689560207c5e07809 |
| User & Date: | js on 2022-07-31 13:55:49 |
| Other Links: | branch diff | manifest | tags |
Context
|
2022-07-31
| ||
| 13:56 | PLATFORMS.md: Add Nintendo Switch (Closed-Leaf check-in: b366e52dee user: js tags: nintendo-switch) | |
| 13:55 | Add initial socket code for Nintendo Switch (check-in: a30a0ab261 user: js tags: nintendo-switch) | |
|
2022-07-17
| ||
| 22:49 | Add support for files on Nintendo Switch (check-in: 3228d624fe user: js tags: nintendo-switch) | |
Changes
Modified src/OFFile.m from [732a34cd87] to [6bda5c55f7].
| ︙ | ︙ | |||
169 170 171 172 173 174 175 | return MODE_READWRITE; } return -1; } #endif | < < < < < < < < < < | 169 170 171 172 173 174 175 176 177 178 179 180 181 182 |
return MODE_READWRITE;
}
return -1;
}
#endif
@implementation OFFile
+ (void)initialize
{
if (self != [OFFile class])
return;
#ifdef OF_WII
|
| ︙ | ︙ | |||
203 204 205 206 207 208 209 | #ifdef OF_NINTENDO_SWITCH if (R_SUCCEEDED(romfsInit())) /* * Errors are intentionally ignored, as it's possible we just * have no romfs. */ | | | 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 |
#ifdef OF_NINTENDO_SWITCH
if (R_SUCCEEDED(romfsInit()))
/*
* Errors are intentionally ignored, as it's possible we just
* have no romfs.
*/
atexit((void (*)(void))romfsExit);
#endif
}
+ (instancetype)fileWithPath: (OFString *)path mode: (OFString *)mode
{
return [[[self alloc] initWithPath: path mode: mode] autorelease];
}
|
| ︙ | ︙ |
Modified src/OFSocket.m from [8f11763ca5] to [16116f3ca3].
| ︙ | ︙ | |||
52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# include <proto/exec.h>
#endif
#ifdef OF_NINTENDO_3DS
# include <3ds/types.h>
# include <3ds/services/soc.h>
#endif
#if defined(OF_HAVE_THREADS) && (!defined(OF_AMIGAOS) || defined(OF_MORPHOS))
static OFMutex *mutex;
static void
releaseMutex(void)
{
| > > > > > > | 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# include <proto/exec.h>
#endif
#ifdef OF_NINTENDO_3DS
# include <3ds/types.h>
# include <3ds/services/soc.h>
#endif
#ifdef OF_NINTENDO_SWITCH
# define id nx_id
# include <switch.h>
# undef id
#endif
#if defined(OF_HAVE_THREADS) && (!defined(OF_AMIGAOS) || defined(OF_MORPHOS))
static OFMutex *mutex;
static void
releaseMutex(void)
{
|
| ︙ | ︙ | |||
126 127 128 129 130 131 132 133 134 135 136 137 | if ((ctx = memalign(0x1000, 0x100000)) == NULL) return; if (socInit(ctx, 0x100000) != 0) return; atexit((void (*)(void))socExit); # endif # if defined(OF_HAVE_THREADS) && (!defined(OF_AMIGAOS) || defined(OF_MORPHOS)) mutex = [[OFMutex alloc] init]; atexit(releaseMutex); | > > > > > < < < < < | 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 |
if ((ctx = memalign(0x1000, 0x100000)) == NULL)
return;
if (socInit(ctx, 0x100000) != 0)
return;
atexit((void (*)(void))socExit);
# elif defined(OF_NINTENDO_SWITCH)
if (R_FAILED(socketInitializeDefault()))
return;
atexit(socketExit);
# endif
# if defined(OF_HAVE_THREADS) && (!defined(OF_AMIGAOS) || defined(OF_MORPHOS))
mutex = [[OFMutex alloc] init];
atexit(releaseMutex);
# endif
initSuccessful = true;
}
OF_DESTRUCTOR()
{
|
| ︙ | ︙ |